Repository navigation
fix(ci): count merge-queue removals, not failed groups, in signal 4 - #16899
Conversation
The monitoring lane's merge-queue-ejections signal fired on the count of failed merge-group runs. A failed group is not always a removal: the queue rebuilds a group behind an entry that left, and in a 15-PR sample 33 failed runs were 18 removals. The collector now reads, in one GraphQL query per 25 pull requests (at most 50), the merge-queue timeline of each pull request whose merge group failed in the last 24 hours, reaching 6 hours further back for each removal's enqueue. The signal counts RemovedFromMergeQueueEvent items with reason failed_checks (the reason babysit_merge.py counts; manual dequeues and merges carry manual and merged). It leaves out a removal a hold caused after the enqueue: a label merge-holds.mjs labelHolds holds on, added between the enqueue and the removal, or a failed group of that enqueue whose queue-hold step failed with switchHold's kill-switch line (read from the annotations of that step's job, for the newest 10 groups only). The kill-switch match needs the removal's enqueue on the page read, as the label rule does, so a group from an earlier enqueue never excludes a later removal. A test pins the two step names to pr-require-checks.yml. Failed runs still fold into one group per gh-readonly-queue branch, since one merge group can fail in more than one workflow; the comment that said so called the group an ejection and is gone. The title and summary carry the counted removals. The fingerprint is the newest counted removal, so an old one leaving the 24-hour window writes nothing. The listing goes from 50 to 100 runs a call, and a listing past it or more than 50 pull requests is a gap that leaves the signal unread. Calls a monitor run adds: 1 GraphQL query per 25 pull requests with a failed group (2 at most), and for the newest 10 groups the annotations of each failed queue-hold job (one GraphQL batch, or one REST read each). 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: 9e5680eb43
ℹ️ 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 (incremental): PR #16899, from 9e5680e to ba07ee0No security issues found. This lane already reviewed an earlier head of this pull request, so this pass reported only CRITICAL and IMPORTANT findings. There were none. Scope. I read every hunk of all 4 files in this push's diff:
None of these files matches a trusted path. What changed. The monitoring collector's merge-queue timeline query now also asks for
What I checked:
API spend. The same query now reads one more small field. That uses existing token quota, not a billed resource. There is no manifest change, no standing-instruction deletion and no prior finding to repeat. critical-findings: 0 |
|
claude-review reviewed Code review (incremental, blocking only): no blocking findingsI reviewed only what changed since The new commit adds a check for a cut-off timeline read. The timeline query now asks for What I checked:
I did not run any tests. The PR description says the truncated-timeline test was red before the fix and green after it. That is the author's claim, and I have not verified it. API spend: this adds one field to the GraphQL query that already runs and adds no new calls. It spends only API rate quota. Nothing is billed. Loosened-check verdict: fail (default, because the prompt had no Verifier dropped 0 of 0 candidates. |
The timeline read takes each pull request's newest 100 merge-queue and label items in the window. A pull request with more lost its older removals with no gap, so signal 4 could read clear on a partial count and close its incident. The query now asks for pageInfo.hasPreviousPage. When it is true for any pull request, the source records a gap, which leaves signal 4 unread for that run, as the failed-run listing past its 100 does. An answer without page info is a failed read. It does not page further: the read stays at one GraphQL query per 25 pull requests, and 100 such items for one pull request in 30 hours is far past the busiest timelines read for this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: #14293 is filed by the monitor itself, so it carries no human-written spec
Summary
The monitoring lane's signal 4 (
merge-queue-ejections) counted failed merge-group runs and called them ejections. A failed group is not always a removal. The merge queue rebuilds a group that sits behind an entry that left, and that rebuild removes nothing. The signal now counts pull requests the merge queue actually removed for failed checks. It leaves out removals caused by a hold applied after the PR was queued, which the loop-lane contract intends.A read-only classification of the 147 failed or cancelled merge-group runs from 2026-11-10 to 2026-11-17 (90 PRs, 1,411 merge-group runs listed) found:
do-not-mergeadded while queued: 43372333635GITHUB_TOKENcore pool, for example 42978333308 and 43149751867.Fix
collect.mjs, sourcemerge-queue ejections:ADDED_TO_MERGE_QUEUE_EVENT,REMOVED_FROM_MERGE_QUEUE_EVENTandLABELED_EVENTitems. The query covers the last 24 hours plus a 6-hour lookback, so each removal can find its enqueue.queueRemovalskeeps removals with reasonfailed_checksand dropsmanualandmerged, the same reasonbabysit_merge.pycounts. Each kept removal carries its enqueue and the labels added between the enqueue and the removal.switchHold's kill-switch line.pageInfo.hasPreviousPage), is a gap that leaves the signal unread.signals.mjs,ejectionFindings:merge-holds.mjslabelHoldsholds on was added while queued (do-not-merge,needs-human,pr-verify-failed,security: outside-actor), or when a failed group of that enqueue hit the kill switch.signalfield"4 merge-queue ejections"is the signal's id, as in"2 ceiling"and"13 lane holds". It is not a hardcoded count, and it is unchanged:issues.mjskeys on it.docs/conventions/pr-pipeline/README.mdis updated, plus a pr-pipeline patch fragment.pull-requests: read.Verification
'Merge queue: 6 ejections…' !== '…4 ejections…'), and the collect suite failed on the missing export.node --testover the fivemaintenance-monitor-signalssuites passed 208 of 212 tests. The truncated-timeline tests failed before the fix (no gap recorded) and pass after it;pageInfo.hasPreviousPagewas confirmed live on the same filtered query. The 4 failures are the Work status rewrite tests inmonitor.test.mjs. They cannot importajvfrom.github/actions/resolve-config, because the local worktree has nonode_modulesin that directory. They do not involve this change.pr-require-checks.yml.batchQueryaliases,since:,last: 100, the three item types) was run once against GitHub for fix(ci): keep the old-path gitleaks ignore for the moved rules file #16725 and test(prototype): wait for the frame's Esc to reach the host #16692. It returned no errors, and the items matched the fixtures.do-not-mergeadded at 13:57:10Z, between its enqueue at 13:52:52Z and itsfailed_checksremoval at 13:59:03Z.failed_checksremoval and onemanualremoval by a person.failed_checksremovals while the release bot re-queued it.pr-verify-failedadded while queued.Related
GITHUB_TOKENspend behind the rate-limit failures.Remaining
LIMITS.mergeGroupRuns), and only from the queue-hold step annotations. A kill-switch removal whose group falls past those 10 is still counted.pr-verify-failedadded while queued is treated as a hold applied after queueing and is not counted (test(prototype): wait for the frame's Esc to reach the host #16692). The gap behind it remains: a head enqueued before pr-verify judged it. Counting it again is a one-line change toisHoldLabel.status=failureruns.🤖 Generated with Claude Code