Repository navigation
fix(dispatcher): only the queue's own merge_group run fails it - #323
Conversation
A failing check suite on a gh-readonly-queue/* branch was read as the queue's CI failing, whatever app posted it. On SahajAtlasWeb#489 another app's suite failed at 21:24Z while the queue's own Actions run was still going; that run concluded success at 21:27:02Z and GitHub merged the PR 32 seconds later. The dispatcher had already recorded queueFail against head 6ccbee46, bumped fixCi to 2, and spent a fix-ci session that found nothing to repair. Because the record is kept against the head while nothing re-arms it, every later pass repairs rather than re-arms, to ciFixIterations and a handback, on a PR whose required checks are green. The PR-head path never read a failure that way: gather drops ci.ignoreCheckNames and reduces to the base ruleset's required checks first, so another app's suite is advisory there. It is advisory on the ephemeral branch too. A workflow_run is always Actions; a check_suite must now say app.slug === 'github-actions', and anything else is logged and ignored. Reading the queue branch's own run back before firing was rejected: it costs a call per event and still races, since that run was in progress when this event arrived. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U
resolve passed only `run`, which is null for a check_suite event, and decide stored that — so after SahajAtlasWeb#489 nothing could say which app's suite had spent the repair passes. The ticket for it could not name the app either. queueFail now carries the app slug beside the sha and the suite or run url, the rendered status line names the app, and the resolve log line names both beside pr#<n>:queue-failed. targetLabel is the one formatter for that line, in the file that owns the queue reason, so index.mjs stays generic. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U
The review pass on the two commits above. A check_suite carries no html_url, so recording its API url as `run` put an api.github.com endpoint behind a [run] link in the public status comment and handed it to a fix-ci session as flags.queueRun — which a routine cannot reach at all. `run` now stays a page a person can open, null for a suite as it was before, and the suite's own url is recorded as `suite`. Also from the pass, all quality: the one-call-site queueFailure helper folds into the branch that needs it, which reads the app slug once instead of twice and no longer shares a name with decide.mjs's queueFailure; targetLabel takes the coalesced shape its only caller passes; the test fixture splits into a flat queueRun and queueSuite; and the app-less patch case goes, since it asserted a defensive default rather than anything resolve can produce. why.md no longer claims the queue path and the PR-head path share a definition of CI. They do not: gather keeps a required check whoever posts it, resolve keeps an Actions check whether required or not. It now says the queue path approximates the required-check reduction by the posting app, because a check_suite event carries no check names, and names the two assumptions that make the approximation safe. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXNxbxE4rDVFNUWE1U
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the size of #321 and no bigger — the narrowing, the record, the log line, a test per direction — and nothing unrelated rides along. The shape question it leaves open is the right one: app.slug names who posted a suite, never what triggered it. My second opinion on that thread is B, not the built option: the workflow_run leg already carries this repo's required check, and the check_suite leg is the only path that can admit a non-CI Actions check run.
Two consequences of the equality test. queueFail.app can hold one value, so criterion 3's "names what failed" buys a constant. And the app that needed naming on #489 is the one the fix now ignores — a core.info line, no record. That is the right call, but it leaves the third-party-required-check assumption why.md names traceable only in a job log. No cross-repo contract is touched.
Findings
should-fix—queueFail.appis alwaysgithub-actions; the field records nothing.dispatcher/decide.mjs:1180should-fix— therun/suiterationale has two homes, againstdocs/documentation.md.docs/why.md:1735
What was checked
Read whole on the branch: resolve.mjs, record.mjs, decide.mjs's queueFailure/repairPlan/route paths, gather.mjs:342-356 for the PR-head test this approximates, workflow-state.yml's on: block, ci.yml's triggers, docs/documentation.md. Grepped every queueFail/queueRun reader. ## Change outline matches the diff; no path or link the body names is absent from the branch, and this repo publishes no preview. Ladder walked for ACTIONS_APP and the core param. The streamliner covered 3 pieces and kept 2; its one finding — drop the ignored-suite core.info — I dropped, because the new test pins that log and it is the only trace of the failure mode why.md calls unasserted.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The reason `run` stays a page and a suite's API url goes under `suite` was in two homes: this clause and the code comment at `dispatcher/resolve.mjs`. `docs/documentation.md` gives a fact one home and every other mention a link, with code above prose, so the comment is the home and the clause goes. The clause also rested on `flags.queueRun` handing the url to a session, which no skill reads — `git grep queueRun workflow/` finds nothing. The comment states the same intent without leaning on that claim. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXPtAcurMDPYg2dnop
|
Pushed
The question thread stays open and waits on you. The critic's second opinion there is B.
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
The reviewer answered B on the question thread: a queue failure resolves only from a `workflow_run` whose `event` is `merge_group`, and a queue `check_suite` resolves to nothing at all. `app.slug === 'github-actions'` named who posted a suite, never what triggered the run. An Actions suite aggregates every Actions check run on the sha — the `dispatch / *` ones `ci.ignoreCheckNames` drops on the PR head included — so a non-required Actions workflow failing on the ephemeral branch still spent a repair pass. `workflow_run.event` is in the payload, costs no call, and names the queue's own gate by definition. Two fields go with the suite leg. `queueFail.app` could hold only `github-actions` while the test was an equality, and now has no event to read it from; `suite` held the API url a routine cannot reach, and no suite reaches this reason any more. The record keeps `run`, which a `merge_group` run always carries as a page. This unmeets #321's acceptance criterion 2 as written, which the reviewer amended by choosing B. Criteria 2 and 3 are updated there with review lines. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVTTAxuwtwZczheDpn
Relative to `main` the `queueFail` patch assertion never changed — the `app`/`suite` fields were added and removed inside this branch — so the comment explaining them describes nothing the diff does. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVTTAxuwtwZczheDpn
|
Pushed
Your approval was submitted 7 seconds after the answer, so it predates this build.
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Summary
gh-readonly-queue/*branch resolves toqueue-failedonly when it is aworkflow_runthemerge_grouptrigger ran. A queuecheck_suiteresolves to nothing.resolvelog line names the run that failed, so the next reader can tell which one spent the repair passes.Change outline
The queue path's decisions. Only the trigger test is new; the branch match and the
cancelledexclusion are unchanged.What an operator sees afterwards. A queue failure used to leave a line naming nothing, and an ignored one left no line at all.
targetLabelis new and exported fromresolve.mjs, the file that owns the queue reason, soindex.mjsstays generic.Test results
claude plugin validate ./workflow --strictpassed,node --test workflow/lib/*.test.mjs194 passednode --test dispatcher/test/*.test.mjs470 passed.claude/worktrees/<slug>worktreeBoth new cases produce a target against
resolve.mjsas it stands onmain: the queuecheck_suiteyieldsqueue-failedwithrun: null, which is the SahajAtlasWeb#489 record exactly, and apull_request-triggered run on the ephemeral branch yields one too.Manual verification
pr#<n>:queue-failed(<run url>)— worth reading once in theresolvejob log.Notes for reviewer
The approach changed in review. You answered B on the question thread: test what triggered the run, not who posted the suite. That is what this branch now does, and it unmeets #321's criterion 2 as written — criteria 2 to 4 there carry the amendment as review lines.
The net diff against
mainis four files and 86 added lines. Two fields the earlier revisions added,queueFail.appandqueueFail.suite, are gone again:appcould hold onlygithub-actionswhile the test was an equality and now has no event to read it from, andsuiteheld an API url a routine cannot reach on a leg nothing reaches.dispatcher/decide.mjsanddispatcher/record.mjsare therefore byte-identical tomain. The record keepsrun, which amerge_grouprun always carries as a page a person can open.Six commits, each separately revertable.
origin/mainis merged in, cleanly, with no conflict.Judgement calls, yours to overturn:
'merge_group'is a literal inresolve.mjs, not aloop-config.jsonvalue, beside thegh-readonly-queue/regex it belongs with. It is GitHub's own event name, not tunable per repo.core.infoline on an ignored failure stays, and a test pins it. It is the only trace of the failure modedocs/why.mdcalls unasserted, and B removes no path that produced a record.One assumption survives, named in
docs/why.md#a-queue-failure-is-a-ci-failure: that every check a ruleset requires in the queue is an Actions workflow triggered bymerge_group, asci.ymlis here. A repo whose queue gate is a third-party context would record no queue failure when it failed. The critic flagged that it read only this repo; I have not read the other four's rulesets either, because a routine cannot. The cost if it is wrong is the #959 eject-and-re-arm loop returning for that repo, visible as a PR that never merges.Dismissed findings, both pre-existing and both carried from earlier revisions:
record.queueFail.queueFailureis already scoped to the head and to an unarmed PR, so a new head or a re-arm ends it, and the ceiling plus handback is the designed exit. It only bites when the trigger was wrong, which is what this PR narrows.renderRecordcould escape-so no record value can contain theENDmarker. Real property of the serializer, no measured harm, and this PR adds no record field at all now.Detail
Fixture pre-mortem. The test payloads assume a
workflow_runcarrieseventandhtml_url, and that acheck_suitecarries neither.eventis documented on Get a workflow run as the event that triggered the run, and the merge queue's event name ismerge_group— the triggerci.yml:20subscribes to. The check suite schema has no trigger field of any kind. Neither value is readable from a routine: the MCP projections of a real check run drop both, and non-searchgh apireads are closed to it. This is better grounded than theapp.slug === 'github-actions'value it replaces, which no schema documented at all.Behaviour against
main, measured. Run againstorigin/main'sresolve.mjs, a queuecheck_suitewith conclusionfailurereturns[[959, 'queue-failed', { run: null }]], and a queueworkflow_runwithevent: 'pull_request'returns[[959, 'queue-failed', { run: 'https://run' }]]. Both are zero targets on this branch, each with acore.infoline.Reviews that ran. The security review ran because
dispatcher/matchessecurityReview.triggerPattern, and reported nothing at or above its bar. It readresolve.mjswhole againstmain's copy,decide.mjs'squeueFailure/repairPlan/case 'queue-failed'/evaluateGreenPrregions,record.mjs,fire.mjs,apply.mjs's arming handlers anddispatcher.yml's triggers, and found the change monotonically restrictive: every payload that now returns[]previously produced a target, the rejected event does not fall through to the PR-headcipath, and a missed classification costs the #959 loop rather than a merge-gate bypass, since arming is gated bymayArmand the merge by GitHub's ruleset.comment-lint.mjsadded nothing banned. No/simplifyor/code-reviewpass:address-reviewruns the security review, the gate and the docs sync, not the full ship pipeline.Docs.
docs/why.md#a-queue-failure-is-a-ci-failureis the only surface that describes this; a grep formerge_group,queue-failed,gh-readonlyandqueueFailacross every.mdand.jsonfinds one other mention, indocs/rollback/README.md, which the change does not make stale.Closes #321