Repository navigation
fix(pr-pipeline): isolate pr-merge re-fire failures per PR and skip workflow-owned branches - #11283
Conversation
…orkflow-owned branches Run 41065454536's merge job failed because one PR's re-fire ref update (#11271 on release/plugins) answered 422 and the step exited 1. - Each failed run read, marker comment or ref update is now a ::warning:: for that PR; the others still re-fire and the step passes. A closing `refire-refused: outcome re-fired=N failed=N skipped-owned=N deferred=N` line counts them in the log and step summary. Setup errors and a failed run listing still fail the step. - New merge.refire-skip-branches config key (schema, resolver default []), set to [release/plugins] in pr-pipeline.yaml. The step reads it from resolve-config's output, so skipping another owned branch takes only a config edit. An unreadable or malformed list stops the step before any push. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The lanes review of 76e60c9 found that every per-PR error had become a warning, so a 401 or 403 on every write, a persistent 5xx or a failed main blob read still passed green. Only a PR that changed since the listing, or a 409 or 422 on the new commit or the ref update (the branch moving under the push), now warns for that PR. Any other failure stops the run with ::error and exits 1. The outcome line is still logged when the run stops. New tests cover a 409 commit write, a 403 ref update, a missing main blob and a failed run listing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A new commit object names only its tree and parent, so no branch move can refuse it: any error writing it now fails the step. A 409 or 422 on the ref update re-reads the branch: moved or deleted warns for that pull request alone, still at the head it was read at fails the step. A push that has not landed an hour after its marker is now a warning, so a person looks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A 500 on the re-read, or an answer with no SHA, fails the run at that pull request instead of warning. 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 Incremental review of |
|
claude-review reviewed Incremental review of The only change adds "or whose tip cannot be read again" to the list of failures that still fail the step. That matches the PR description. There, a re-read after a 409 or 422 that answers anything but 200 or 404, or returns no SHA, stops the run with The fragment is prose only, so it adds no security surface. It changes no behavior and spends no billed resources. |
|
The pr-verify verifier failed head What it wrote (29 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
…log fragment Co-Authored-By: Claude Opus 5.5 <[email protected]>
No related issue: a defect in pr-merge's re-fire step that poteto (the pr-merge owner) assigned directly, with the fix shape agreed, after run 41065454536 failed.
Summary
Run 41065454536's merge job failed at "Re-fire lane runs refused as workflow-modified" with
#11271: PATCH /repos/melodic-software/claude-code-plugins/git/refs/heads/release/plugins failed with status 422. #11271 is the release PR onrelease/plugins, a branchrelease-publish-plugins.ymlowns and rebuilds. The step already went on to the other PRs after that error, but it exited 1 at the end, so a failure on one PR failed the whole job.Fix
.github/scripts/pr-merge/refire-refused.mjs, these are reported as::warning title=refire-refused::#N: ...without changing the exit code, and the other PRs still re-fire:GitHubError409 or 422 on the ref update (PATCH git/refs/heads/<branch>) when a freshGET git/ref/heads/<branch>answers 404 (the branch is gone) or a SHA other than the head the push was built on (the branch moved).::errorand exit 1, and no further PR is pushed. A fast-forward refused on a branch that did not move is not a race, so it would hit every PR.POST git/commitsgoes through the plain client: a commit object names only its tree and parent, so no branch move can refuse it, and any error there (a 409 included) exits 1 with::errorat the first PR.::error. This covers an auth refusal, a server error after retries, a failed run, comment or refusal read, a main blob read inblobOf, setup errors (repository name, a tag named main, main's tip, the sender id, the skip list) and a failed run listing for a lane. Such failures would hit every PR the same way, so a green step would hide them. The lanes review of 76e60c9 asked for this split.::warning title=refire-refused::#N not re-fired: its push for <file> at <blob> did not land; a person looks, so it shows in the run's annotations.refire-refused: outcome re-fired=N failed=N skipped-owned=N deferred=Nonce it has listed the PRs, whether or not the run stopped.merge.refire-skip-brancheskey is added topr-pipeline.schema.jsonand resolved inresolve-config'sresolveMergewith a default of[].docs/conventions/pr-pipeline.yamlsets it to[release/plugins]. The step reads the key fromresolve-config's output file, which the merge job's config step already writes, through the newRESOLVED_CONFIG_PATHenv inpr-merge.yml. This is the same file themodestep readsmerge.lane-prsfrom. An owned PR is dropped when the open PRs are listed, so the step spends no reads on it, never comments on it and never pushes to it. Skipping another owned branch takes only a config edit. A missing or malformed list stops the step before any push..changes/pr-pipeline/(minor: new config key).Verification
TDD: each new behavior's test was written first and failed against the script as it stood. The tests in
refire-refused.test.mjsthat pin this PR's behavior:re-fired=2 failed=1);::error, and the next PR is not pushed;::errorand no warning;::error, one commit write attempted and no warning;::warning title=refire-refused::#9 not re-fired: ...;pr-unblock.ymlrun listing each exit 1;release/pluginsPR is never commented on or PATCHed while another PR is; the skip list comes from config; an unreadable or malformed config stops the step before any push.The fail-closed re-read test was checked by changing both branches to warnings: it went red, and the code was restored.
Run with
node --teston head 791b9fa (origin/mainmerged; the remerge-diff is empty):.github/scripts/pr-merge/refire-refused.test.mjs.github/scripts/pr-merge/workflow.test.mjs(new test: the step'sRESOLVED_CONFIG_PATHis the config step'soutput-path).github/scripts/pr-merge/merge-job.test.mjs.github/scripts/pr-merge/.github/actions/resolve-config/merge-authority.test.mjs(new test: the key is validated and the schema default equals the resolver's).github/actions/resolve-config/live-config.test.mjs(new test: the live config skipsrelease/plugins)scripts/check-changelog-fragments.sh --checkexits 0.Related
🤖 Generated with Claude Code