Repository navigation
fix(source-control): wait for pr-verify's verdict before a merge - #18288
Conversation
A session's merge queued heads pr-verify had not judged, or had failed, and the merge queue then removed them. The merge phase now reads the verdict at the pinned head by the four pass names the merge queue's CI Status step reads, waits up to 30 minutes while it is missing, and holds on a FAIL (the pr-verify-failed label), a moved head or a failed read. It applies only where the base runs pr-verify and pr-verify judges the author under merge.verify-authors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ict read A later pass removes pr-verify-failed, so the label outranks an older pass at the same head. The setup reads run once; each 60-second pass reads the pull request and at most four artifact names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 474ed4ba03
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review reviewed Security review: PR #18288 at
|
|
claude-review reviewed Code review (blocking only): PR #18288 at be961f4I read all three changed files in the full diff: the changelog fragment, the new "Read the pr-verify verdict" section in the provider Checked against the code it copies:
Settled threads and prior findings. The four settled threads and the three earlier inline findings are all marked fixed by the owner. The current code matches each fix, so I am not raising any of them again. Closing issue. The PR names #14293 only with Verification. I ran nothing. The Spend. Polling every 60 seconds for up to 30 minutes uses about 5 GitHub API calls per poll, plus one per matching artifact. That is only the session's GitHub API budget. Nothing here changes billing. Loosened checks would be marked: fail (default; the prompt has no Under the blocking-only rule I dropped two non-blocking candidates myself, without a verifier. Verifier dropped 0 of 0 candidates. |
With pr-verify down, the 30-minute wait now ends in a merge that reports no verdict was read, not a hold. The merge queue's check requires a pass only for lanes App pull requests (pr-require-checks.yml, the verdictHold comment in ci-status), so a hold on every other author would be a new stop the queue itself does not make. A FAIL, a moved head or a failed read still holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…inished passes The verdict wait now answers "nothing to wait for" for a PR pr-verify's resolver skips before verify-authors (a base other than the default branch, a fork head, a dependency-manager Bot author), so a Dependabot merge no longer sits out the 30-minute wait. A failed pr-verify.yml lookup holds; only an HTTP 404 means the base has no pr-verify. A pass artifact counts only when its run is a completed, successful pr-verify.yml workflow_run of this repository on the default branch, as the merge queue's CI Status step requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…remote's The skip check and the verdict-run check compared GitHub's canonical full_name with the owner/repo typed in the remote URL, so a remote that differs only in case skipped the wait or matched no run. Both now compare against the PR's base repository as the API spells it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs: #14293
Summary
The merge queue keeps removing groups. Over the 24 hours to 2026-11-22T23:05Z, 8 merge-group runs failed. Each failed job's annotations were read:
mask.test.tslinearity timing flake (Check Catalog)git fetchanswered HTTP 403No run in that window failed at the token floor (#16642). #18227 fixed the flake at 20:21Z.
The two pr-verify removals came from session merges:
CI Statusreadpr-verify's reader refuses this head (verify:fail), and thepr-verify-failedlabel followed at 21:27:16Z.Both were queued under the owner login through the merge phase. That phase never read pr-verify's verdict.
Fix
plugins/source-control/skills/pull-request/reference/merge.md§4.1 adds step 3. When the base runs pr-verify and pr-verify judges the PR's author, the merge phase reads the verdict at the pinned head and merges or enqueues on a pass. While the verdict is missing, it reads again every 60 s for up to 30 minutes. A FAIL, a moved head or a failed read holds. With still no verdict after 30 minutes (pr-verify down, or a head it skips), it merges and reports that no verdict was read, so a pr-verify outage stops no merge. The step applies to a user-approved merge and to a merge after AI review (§4.2.1). The approval step is renumbered from 4 to 5, and its two references are updated.plugins/source-control/reference/providers/github/pull-request/merge.mdadds "Read the pr-verify verdict". The command finds pr-verify by.github/workflows/pr-verify.ymlat the base commit. It decides which authors pr-verify judges frommerge.verify-authors, the lanes App identity and the trusted-actor list, asresolve-pr.mjsdoes. It then reads the four exact pass names the merge queue's CI Status step reads (-passand-pass-notes, each with and without the head-branch digest), counting only unexpired artifacts from default-branch runs. A FAIL is thepr-verify-failedlabel.babysit_verify_evidence.py evidence, the lanes' reader. Run from a session against this repository, it refused (38339 artifacts in 384 pages need 391 s for a whole listing ... past the 300 s listing cap). It lists every artifact, so its cost grows with the repository..changes/source-control/fix-merge-waits-for-pr-verify-c722d483.md(patch).Verification
I ran the provider command as written, with the placeholders filled, read-only:
84974538f6bf(merged, author kyle-sexton) printsallowfrom its-pass-notesartifact.bb679247fa55, a fresh head pr-verify had not judged yet, printsmissing.failbranch live: no open PR carriespr-verify-failedright now.These checks pass on the branch:
scripts/check-affected.sh --base origin/main(22 passed, 2 skipped),scripts/check-changelog-fragments.sh --checkandscripts/check-org-repo-tokens.sh --check.Why the wait ends in a merge, not a hold
The merge queue's own
CI Statusstep requires a pr-verify pass only for a lanes App pull request (.github/workflows/pr-require-checks.yml, the ci-status comment onmerge-holds.mjsverdictHold: "in the merge queue a lanes App pull request also needs a verifier pass at its head"). For other authors the queue admits a head with no verdict. A hold after 30 minutes would therefore be a new stop the queue does not make, and during a pr-verify outage it would stop every session merge. So the wait only avoids queueing into a FAIL that is about to land; with no verdict by then, the merge goes ahead. A lanes App PR's FAIL sets no label and readsmissing, and the queue's own check still holds it.Remaining
Related
mask.test.tsflake.🤖 Generated with Claude Code