Return handler and job_runner_name to admins from the job show endpoint - #23456
Merged
jmchilton merged 1 commit intoSep 4, 2026
Merged
Conversation
JobSummary documents both fields as "Only administrator can see this
value", but Job.to_dict only populated them for the admin_job_list view.
GET /api/jobs/{id} goes through view_show_job, which uses
to_dict("element", system_details=is_admin), so an admin reading a
single job got external_id, command_line and traceback but always null
for handler and job_runner_name.
Move both into the system_details branch. The admin_job_list view is
unaffected: its condition already includes system_details.
This matters for anything that reads jobs one at a time. The AnVIL tool
test harness records the full job object for every test it runs, so its
reports carry a job_runner_name column that is null on every row, and
which job runner a failing job used cannot be recovered afterwards.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jmchilton
approved these changes
Sep 4, 2026
jmchilton
left a comment
Member
There was a problem hiding this comment.
If the API tests are fine, this looks great to me.
|
This PR was merged without a "kind/" label, please correct. |
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.
JobSummarydocumentshandlerandjob_runner_nameas "Onlyadministrator can see this value", but
GET /api/jobs/{id}never returnsthem — an admin always gets
nullfor both, whileexternal_idandcommand_lineon the same response are populated.Cause
Job.to_dictgates the two groups differently:GET /api/jobs/{id}goes throughview_show_job, which callsto_dict("element", system_details=is_admin). That reaches the firstbranch but never the second, so the two fields are simply absent from the
dict. Because the pydantic models declare them
Optional[str] = None,they serialize as
nullrather than being omitted, which makes it looklike the values are missing rather than never populated.
Fix
Move
handlerandjob_runner_nameinto thesystem_detailsbranch.The
admin_job_listview is unaffected — its condition already includessystem_details, so it keeps returning both.Why this matters
Anything that reads jobs one at a time loses the runner. The AnVIL tool
test harness records the full job object for every test it runs, so every
report it publishes carries a
job_runner_namecolumn that isnullonevery row, and which runner a failing job used cannot be recovered after
the instance is gone.
Testing
Adds
test_show_system_details_admin_only, asserting both fields areNonefor a non-admin and non-Nonefor an admin on the show endpoint.It uses
__history_with_new_dataset, which waits for job completion, sothe values are reliably set by then.
🤖 Generated with Claude Code