Return the assign response from Job.assign - #83
Merged
abreckner merged 3 commits intoAug 18, 2026
Conversation
abreckner
force-pushed
the
tonybreckner/neb-641-return-assigned-job-from-job-assign
branch
from
August 18, 2026 02:49
b047c4c to
022d17d
Compare
abreckner
changed the base branch from
master
to
tonybreckner/fix-ci-ruby-setup
August 18, 2026 02:49
XPM's job.api/assign response is a full Job document carrying the authoritative post-assignment state: the assigned staff, manager and partner. Job.assign discarded all of it and returned only the status string, so a caller could learn that a request succeeded but never what XPM actually recorded — leaving no way to tell a partial assignment from a complete one. Return response["Job"] instead, matching add, update, get and applytemplate, which already return the job. The status is not lost as a signal: Connection#handle_response raises ApiError on ERROR, so assign either returns the job or raises. The existing assign cassettes already contain the full payload, so the specs now assert on the confirmed assignment rather than on "OK". Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
CI installs in frozen mode, so the lockfile has to record the version the gemspec resolves. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
abreckner
force-pushed
the
tonybreckner/neb-641-return-assigned-job-from-job-assign
branch
from
August 18, 2026 02:56
022d17d to
3c1f158
Compare
Digging out "Job" traded one loss for another: a caller checking the outcome could no longer see the status, and neither half is recoverable from the other. Return the whole response so both are available. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
abreckner
deleted the
tonybreckner/neb-641-return-assigned-job-from-job-assign
branch
August 18, 2026 03:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
XPM's
job.api/assignresponse is a full document carrying both the outcome and the authoritative post-assignment state — the assigned staff, manager and partner:Job.assignreduced all of that toresponse["Status"]— the string"OK". A caller could learn that the request succeeded but never what XPM actually recorded, so there was no way to tell a partial assignment from a complete one.That gap is the root of a recurring class of support issue in the app: workflows deploy to XPM "successfully" with staff, manager or partner silently missing, and nothing durable records what the provider confirmed. Needed by NEB-641.
What
Job.assignnow returns the whole response hash, so callers get both"Status"and"Job".Returning the response rather than digging out one key is deliberate: a caller checking the outcome and a caller reading the confirmed assignment both need it, and neither half is recoverable from the other. It does make
assignthe one method here that returns the envelope rather than a member —add,update,getandapplytemplatereturnresponse["Job"], whilestateanddeletereturnresponse["Status"]. That asymmetry is the point:assignis the only call whose result is interesting on both axes.Compatibility
This changes a public method's return type, hence the minor bump to 0.5.0.
The only consumer is
XpmIntegration::Job::Api.assign_staffin Practice-Ignition, which currently discards the return value, so nothing breaks on the bump. Callers that want the confirmed assignment readresponse["Job"]; callers that want the outcome readresponse["Status"].Worth knowing for anyone relying on the status:
Connection#handle_responseraisesApiErroronStatus == "ERROR"beforeassignever returns, so in practice"Status"is always"OK"on the success path.Testing
The existing assign cassettes already contain the full payload, so no re-recording was needed. The six assign examples now assert on both halves — the status, plus that
Assigned/Staff,ManagerandPartnercome back on the add paths and are absent on the remove paths. That is materially stronger than the previouseq("OK").bundle exec rake→ 93 examples, 0 failures;bundle exec rubocop→ 46 files, no offenses.🤖 Generated with Claude Code