Repository navigation
ci: trim the queue-on push run only for queue-landed commits - #33450
Conversation
With MERGE_QUEUE_ENABLED set to 'true', every push to main ran only the macOS legs on the premise that a merge group had already tested the tree. The variable says the queue is on, not that the queue made this commit: a direct push, or a merge made while the ruleset has the queue off, got the same trimmed run and landed with no Linux or Windows verdict. Every read of the variable in ci.yml, build.yml and fast-gate.yml now also requires github.actor == 'github-merge-queue[bot]', the actor GitHub records on the push the queue makes when it lands a group. Any other push takes the path an unset variable takes: the full matrix and the per-ref concurrency group. Inert while the variable is unset. Closes #15566
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Every read of the variable that the skip depends on now also checks the actor, at every site that reads it. The defect is tied to #15566, and a test pins it in all three workflows. What this change shipsInventory (6 items) — 6 justifiedIntent: once the merge queue is on, every commit on main still gets a full Linux/Windows verdict unless the queue itself landed it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 6a9eaa1 Description read[DESCRIPTION-READ] 2feffab846b8091ed1299f9b1773d8a875ac75771c04309d761f4526ff95a9ea That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the only behaviour change sends non-queue pushes down the unset-variable path that runs today, and the trim stays inert while Notes
[DESIGN-REVIEWED] 6a9eaa1 Description read[DESCRIPTION-READ] 465f8f088ff862cacf8fb7f81595e149bb2e78fc8b18a72343aceed6e22c794b That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed on head 6a9eaa1. Every expression in ci.yml, build.yml and fast-gate.yml that reads MERGE_QUEUE_ENABLED now also checks github.actor == 'github-merge-queue[bot]'. The skip clauses and the admit and matrix clauses are exact complements. The concurrency groups match across all three workflows. The seven changed test files pass, and the new test fails on the base workflows for all three files. Single-site mutations at the head (the cancel if:, the boot-matrix os: and build.yml QUEUE_ON) each turn the suite red. REST reads of past main push runs show the queue's pushes carry that actor.
Done well: the new test evaluates every job if: and step env: that reads the variable. It requires a push the queue did not make to behave as if the variable were unset, so a future clause without the actor check fails on its own. If the actor check ever misfires, the push runs the full matrix, never fewer jobs.
Security: the flagged file, test/test_vendor_manifest.py, only has a pinned workflow if: string updated. No OAuth scope or manifest content changes. No one can push under the merge queue bot's login, so the actor check cannot be spoofed to get the trimmed run. The runs-on routing is unchanged.
Optional:
await-fast-gate.sharound line 136: with the queue on,prove_supersededcan name a queue-landed Fast Gate run in another concurrency group as the evictor. The run then endscancelledinstead offailure. It never ends green. Filtering candidates by actor or group key would close this.- The Proof line could also list
test_a_push_the_queue_did_not_make_runs_as_if_the_variable_were_unset, the one new behavioural test. docs/request-for-change/rfc-review-loop-and-escaped-bug-reduction.mdline 480 still says a push skipsawait-fast-gatewhenever the variable is set. Consider adding the actor qualifier, or list it in the sibling sweep.
Problem / Motivation
Goal: With the merge queue switched on, a push to main skips the Linux and Windows tests only when the merge queue itself landed that commit, so no commit reaches main without a full test verdict.
Today, once the repository variable
MERGE_QUEUE_ENABLEDistrue, every push to main runs only the macOS legs and trusts that a merge group already tested the tree. The variable cannot tell whether that is true: a direct push to main, or a merge made while the ruleset has the queue switched off, gets the same trimmed run, and its commit lands with no Linux or Windows verdict at all.Why it matters
The trim is inert today (the variable is unset), but once the queue is enabled, any commit that does not go through it (an admin push, or merges after the queue is unticked while the variable stays set) reaches main untested on Linux and Windows, and the break surfaces later on an unrelated PR. The check has to exist before the switch is flipped.
Not a goal
MERGE_QUEUE_ENABLEDvariable or the ruleset: that stays the owner's call.merge_groupruns per commit, or any new job, variable or flag.What changed (motivation → approach → change)
true, pushed by the merge queuetrue, pushed by anyone elseThe variable is the owner's switch: it says the queue is on, not that the queue made this commit. GitHub records
github.actorasgithub-merge-queue[bot]on the push the queue makes when it lands a group, and a re-run keeps that actor. So every placeci.yml,build.ymlandfast-gate.ymlreadvars.MERGE_QUEUE_ENABLEDalso checks that actor: the skip clauses, the macOS-only admit and matrix choices, the per-commit concurrency groups andcancel-superseded-run. A push the queue did not make takes exactly the path an unset variable takes. The CI docs underdocs/ci/, the workflow comments and the ruleset audit (scripts/check_merge_queue_ruleset.py, whose failure message no longer claims the variable alone skips the push run) describe this queue-landed rule.Backwards compatibility
Compatible: with the variable unset, as today, every expression gives the same answer as before; with it set, only pushes the queue did not make change, and they gain jobs rather than lose them.
Removes nothing: the trim applies to fewer pushes; no job, check or path is removed.
Tests
test_fast_gate_barrier.py::TestTheGatesLiveInTheGateWorkflow::test_a_push_the_queue_did_not_make_runs_as_if_the_variable_were_unset(one case per workflow) evaluates every jobif:and stepenv:that reads the variable inci.yml,fast-gate.ymlandbuild.yml: a push by anyone but the queue answers exactly as with the variable unset, and only the queue's own push answers differently.test_fast_gate_barrier.py,test_ci_fleet_routing_expression_parity.py,test_ci_ipv6_routing.py,test_ci_kernel_owner_routing.py,test_builtin_skill_scope.py,test_publish_feed_contract.pyandtest_vendor_manifest.pycarry the actor check.Proof: PROVEN test/test_builtin_skill_scope.py::TestTheCommittedTreeAgrees::test_the_gate_skips_only_the_queued_push, test/test_ci_fleet_routing_expression_parity.py::test_all_fast_gates_skip_only_the_queued_push, test/test_ci_ipv6_routing.py::test_workflow_routes_every_scope_without_changing_local_defaults, test/test_ci_kernel_owner_routing.py::test_the_coverage_artifact_is_required_by_combine_and_gate, test/test_fast_gate_barrier.py::TestTheGatesLiveInTheGateWorkflow::test_every_gate_skips_only_the_queued_push[source-gates] (head 6a9eaa1)
Manual verification
N/A: the queue is off, so no queue-landed push can be observed today; the new test evaluates the real workflow expressions for both actors. The actor premise was checked against main's push runs:
GET /repos/kirodotdev/KiroCrew/actions/runs?event=push&actor=github-merge-queue[bot]returns the runs of the commits the queue landed while it was briefly enabled (for example the push runs for #15784, #16199, #16131 and #16194), each withactorandtriggering_actorgithub-merge-queue[bot].Screenshots / video
N/A: no frontend change.
Related Issues
Closes #15566
Sibling sweep
Swept: git grep -n "MERGE_QUEUE_ENABLED"
Sibling: .github/workflows/ci.yml -- changed here
Sibling: .github/workflows/build.yml -- changed here
Sibling: .github/workflows/fast-gate.yml -- changed here
Sibling: .github/workflows/merge-queue-ruleset.yml -- changed here
Sibling: .github/workflows/main-macos-failure-watch.yml -- changed here
Sibling: scripts/check_merge_queue_ruleset.py -- changed here
Pattern harvest
Not generalizable: the one repository variable that stands in for "a merge group proved this commit" is read only in these three workflows; the new test evaluates every job
if:and stepenv:that reads it, and the concurrency groups and the boot matrix are pinned by exact text.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)