Repository navigation
feat(pr-pipeline): dequeue a pull request when the lanes App adds needs-human - #12608
Conversation
pr-merge.yml wakes on `labeled` too. Only a hold label a person added runs work, and only the enable-auto-merge job's: the label set is enable-auto-merge.mjs HOLD_LABELS plus the tracker's human-gated label, checked by workflow.test.mjs. Any other label, and any bot-sent event, skips every job. The labeled run reads that one pull request live. When a hold label still stands, it takes the PR out of the merge queue with the address-feedback dequeue mutation, now exported, and disarms a lanes App PR that is still armed. It prints one pr-merge-hold-dequeue notice naming the outcome. A labeled run is never superseded, and it runs in a concurrency group of its own, so it does not wait behind a scheduled run's verdict reads. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VcupomBPg7kuobwLoNpxEW
Resolves the overlap with the PR-scoped verdict wake (inputs.pr): the enable-auto-merge EVENT_PR now carries both, the merge job's condition keeps both skips, and evalIf takes inputs alongside contains and fromJSON. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VcupomBPg7kuobwLoNpxEW
…ds-human Drops the person-only `labeled` wake from pr-merge.yml. Instead, the lanes App's own writers of the human-gated label now dequeue the PR they label, when it sits in the merge queue: - report-escalation.sh on the hold route - enable-auto-merge.mjs refusal notes, both where they add the label and where they put it back This is the same step verify-notes.mjs leaveQueue takes for pr-verify-failed. address-feedback.mjs leaveQueueOnHold does one QUEUE_ENTRY_QUERY read and, when the PR is queued, one DEQUEUE_MUTATION, and prints one hold-label-dequeue notice. A refused read or dequeue warns and never fails the label add. report-escalation.sh loads both queries from address-feedback.mjs, so there is one copy of each. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VcupomBPg7kuobwLoNpxEW
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: PR #12608, incremental since 3931880No security issues found. critical-findings: 0 Scope: This was an incremental review. The only changed file is What changed: The push adds one test, "a refused pull request whose label the lane puts back while queued is dequeued". It checks that when the refusal-note path puts
Why it is not a security concern:
Untrusted text: Nothing in the PR context tries to steer the review. Owner threat model: This push weakens, narrows or removes no named friction hold. |
|
claude-review reviewed Code review (incremental, 3931880 → e500cf2): dequeue on a lanes-App
|
…s label back Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VcupomBPg7kuobwLoNpxEW
Closes #12449
Summary
When the lanes App adds the human-gated label (
needs-human) to a pull request that is in the merge queue, it now takes that PR out of the queue at the same call site. Before this, the PR's merge group still ran, andci-statusfailed it on the label. verify-notes.mjsleaveQueuealready did this forpr-verify-failed.Why this design: of the 22 hold-label merge-group failures in the 7-day BEFORE baseline, 9 had the label added after the PR entered the queue (design check):
needs-human, which the lanes App added.pr-verify-failed, whose writer already dequeues.The earlier version of this PR woke pr-merge on a person's
labeledevent. That design catches none of the 5, because a bot-sent event is skipped and the token broker refuses a bot actor. So the dequeue now sits in the writers themselves. The merge-groupci-statusalready re-reads hold labels in the queue (.github/workflows/pr-require-checks.yml). That check stays the backstop, and the dequeue spares the failed group.The label set follows the owner's decision on #12446 (Q3), quoted from the issue comment:
So
needs-humanis the hold these writers add, resolved byhumanGatedLabelFromin.github/scripts/pr-unblock/address-feedback.mjs.needs-sessionis not a hold, andhuman-merge-holdis gone.Fix
address-feedback.mjs:leaveQueueOnHold: after a hold-label add, it makes oneQUEUE_ENTRY_QUERYread. If the PR is queued, it sends oneDEQUEUE_MUTATION.::notice title=hold-label-dequeue::pr=<n> label=<l> outcome=<dequeued|not-queued|refused:<why>>.QUEUE_ENTRY_QUERYandDEQUEUE_MUTATIONare exported, so there is one copy of each.report-escalation.sh, hold route, right after it adds the label. It loads both queries fromaddress-feedback.mjs, which the base-script copy carries beside it, and sends them withgh api graphql.enable-auto-merge.mjs, the refusal note: both where it adds the label and where it puts it back.verify-notes.mjsalready dequeues its own adds (leaveQueue), and is unchanged.GITHUB_TOKEN, not the lanes App token:security-outside-actor/flag.mjscheck-signed-commitsactionpr-merge.ymlis unchanged from main: thelabeledwake, its job condition and its concurrency group are gone.Verification
node --teston.github/scripts/pr-merge/enable-auto-merge.test.mjs,workflow.test.mjsandclear-escalations.test.mjs, and on.github/scripts/pr-unblock/address-feedback.test.mjsandverify-notes.test.mjs: 646 tests, 0 failed..github/scripts/pr-unblock/report-escalation.test.sh: 1147 ok, exit 0.shellcheckis clean on both shell files.refused:dequeue-failed, and the label add and the escalation comment still stand.leaveQueueOnHoldon purpose, and the dequeue tests failed (2 of 2).scripts/check-affected.sh --base origin/main: 11 passed, 4 skipped. No plugin changed, so no changelog fragment is required.needs-humanadd by the lanes App, plus at most one write (the dequeue) when the PR is queued. Every other path makes no new call.hold-label-dequeuenotices withoutcome=dequeued, against hold-label merge-group failures where the label was added after queue entry.Related
verify-notes.mjsleaveQueue: the same step forpr-verify-failed.🤖 Generated with Claude Code
https://claude.ai/code/session_01VcupomBPg7kuobwLoNpxEW