Repository navigation
fix(pr-pipeline): post fix-docs's check on the head it ran on when the PR moves mid-run - #9223
Conversation
…e PR moves mid-run fix-docs passed no head-sha, so the read report job's head step trusted only the PR head it read at report time. A push while the run went made the finished run's head look forged, and the step posted failure on the new head, which blocked the merge until a hand re-dispatch (#9207). A fix-docs-head job, running no head code, reads the PR head and both fix-docs calls pass it as head-sha, as fix-ci does with fix-ci-context's. Closes #9207 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental, 6d25a48 → 41de6a7)No security findings. No manifest, instruction-surface or guardrail changes in this diff, so there are no
|
|
claude-review reviewed Incremental review of 41de6a7 against 6d25a48. The change adds a Finding (1, inline, unconfirmed risk): Checks that passed:
Closing issue #9207: the issue's "Done when" asks for a |
…ispatched again Passing fix-docs a caller head made the report job post neutral not-assessed on it when the run stopped before its trigger gate, and the once-per-PR fix-docs dispatcher then never retried the PR. The read runner's new post-decline input (default true) is false for both fix-docs calls, so a decline posts nothing, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #9207
Summary
When the PR head moved while pr-unblock's
fix-docsran, its report job posted failure on the new head, and the guardrails merge guard refused the merge until someone re-dispatched by hand. Example: on #9201, fix-docs run 39857913086 gated2f0697ef, the head moved to6aed779a, and check 120101945136 posted failure on6aed779a.Root cause. The fault is in the head the check is posted on, not in
decide.mjs. Thefix-docsandfix-docs-subscriptioncalls in.github/workflows/pr-unblock.ymlpassed nohead-sha. The run is aworkflow_dispatch, so it has no event head either. The read report job's "Choose the head the check is posted on" step (.github/workflows/pr-run-activity-read.yml) then trusted only the PR head it read from the API at report time. Any push mid-run made the run's own head look forged, so the step setforged=true, which forcesrun-result: failureand posts on the API head.decide.mjs:107-115only supplies the message text. The report job log for that run shows:fix-ciis not affected, because both of its calls already passfix-ci-context's head.Fix
fix-docs-headjob inpr-unblock.ymlreads the PR head over the API. It runs no head code and holds onlypull-requests: read. Bothfix-docscalls pass that head ashead-sha, the same way fix-ci usesfix-ci-context. When the head moves mid-run, the run's head matches the gated head, so the check posts the run's real outcome on the head it ran on. The new head gets no stale check.pr-run-activity.mdand thehead-shainput description namefix-docs-head. Changelog fragment under.changes/pr-pipeline/.The fix lives in the caller rather than in
decide.mjsbecause the verdict'shead-shais the same value the run job can forge.decidecannot tell a superseded head from a forged one, and turning that mismatch neutral would also turn real forgery neutral. Posting on the run's own head is the "posts on its own head only" option in the issue's direction.How this maps to the Done-when items.
plugins/guardrails/hooks/block-unresolved-pr-merge.sh:675,:709) and blocks only on a completed failing conclusion (:759), so a check on an older commit, or a missing one, does not block..github/actions/resolve-config/callers.test.mjs, beside the other pr-unblock caller-contract tests, and not inreport-check-run/, because the defect is in the caller and the head step.Two limits, both unchanged by this PR.
fix-docsruns once per PR by design.fix-docs-dispatch.mjs:186-189skips any PR whose earlier commit has apr-unblock / fix-docscheck, so the new head does not get its own fix-docs run, before or after this change.fix-docs-headreads the head beforefix-docswaits in thepr-pipeline-write-<pr>queue. If the head moves in that window, the run gates a newer head. The step then treats it as forged and posts failure on the older, gated head, never on the current head, so the merge is not blocked.fix-ci-contexthas the same window.Verification
pr-unblock.yml: a read activity whose PR head moved mid-run posts on its own head, never on the new one. It runs the report job's head step, lifted from the YAML, with each pr-unblock read-call'shead-shaand an API head that moved. It failed before the fix (fix-docs passes the head a base job read: actual'') and passes after. A foreign run head still yieldsforged=true.head-shabehavior for fix-docs.node --testin.github/actions/resolve-config(callers.test.mjs): 97/97 pass..github/actions/report-check-run: 100/100 pass.check-trusted-trigger, every.github/scripts/pr-unblock/*.test.mjs, andpr-merge/refire-refused.test.mjs: 0 failures.scripts/read-runner-dispatcher-gate.test.sh(9/9),scripts/pr-unblock-trusted-base.test.sh(20/20), and the morning-brief suites (450 cases plus the view suite): pass.actionlintis clean on both workflows.zizmor --offlineonpr-unblock.ymlreports no findings.runner-policy.mjs --root .passed.Related
.github/workflows/pr-run-activity-read.yml, the "Choose the head the check is posted on" step🤖 Generated with Claude Code