Skip to content

ci: trim the queue-on push run only for queue-landed commits - #33450

Merged
bolichen97 merged 1 commit into
mainfrom
fix/15566-queue-actor-gate
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/15566-queue-actor-gate

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

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_ENABLED is true, 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

  • Turning the merge queue on, or touching the MERGE_QUEUE_ENABLED variable or the ruleset: that stays the owner's call.
  • A lookup of merge_group runs per commit, or any new job, variable or flag.
  • Changing what a pull request or a merge group runs.

What changed (motivation → approach → change)

Push to main Before After
variable unset full matrix full matrix
variable true, pushed by the merge queue macOS legs only macOS legs only
variable true, pushed by anyone else macOS legs only full matrix

The variable is the owner's switch: it says the queue is on, not that the queue made this commit. GitHub records github.actor as github-merge-queue[bot] on the push the queue makes when it lands a group, and a re-run keeps that actor. So every place ci.yml, build.yml and fast-gate.yml read vars.MERGE_QUEUE_ENABLED also checks that actor: the skip clauses, the macOS-only admit and matrix choices, the per-commit concurrency groups and cancel-superseded-run. A push the queue did not make takes exactly the path an unset variable takes. The CI docs under docs/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 job if: and step env: that reads the variable in ci.yml, fast-gate.yml and build.yml: a push by anyone but the queue answers exactly as with the variable unset, and only the queue's own push answers differently.
  • The exact-clause pins in 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.py and test_vendor_manifest.py carry 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 with actor and triggering_actor github-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 step env: that reads it, and the concurrency groups and the boot matrix are pinned by exact text.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

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
@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 8, 2026 22:15
@bolichen97
bolichen97 requested a review from Zedmor November 8, 2026 22:15
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 ships

Inventory (6 items) — 6 justified

Intent: 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.

  1. A push to main that the queue didn't make (variable true) runs the full matrix again, not just the macOS legs. — justified
  2. That push gets per-ref concurrency instead of per-sha, so a later push evicts it the same way it does when the variable is unset. — justified
  3. cancel-superseded-run and the await barrier run on any push the queue didn't land. — justified
  4. The ruleset audit's failure message no longer claims the variable alone skips the push run. — justified
  5. The CI docs and workflow comments now describe the queue-landed rule. — justified
  6. The exact-clause pins carry the actor check, and a new test checks both actors against every if:/env: that reads the variable. — justified

[FIRST-PRINCIPLES-REVIEWED] 6a9eaa1

Description read

[DESCRIPTION-READ] 2feffab846b8091ed1299f9b1773d8a875ac75771c04309d761f4526ff95a9ea

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

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 MERGE_QUEUE_ENABLED is unset.

Notes

  • "Manual verification: N/A" covers the queue-landed branch, but that branch behaves as before. The new branch, any other push, is the full matrix that already runs today, and the description cites real push runs whose actor is github-merge-queue[bot]. So the N/A trigger does not apply.

[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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6a9eaa1

Verdict parsed from the review's SHA-scoped output markers for commit 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 6a9eaa1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 6a9eaa19cfa76dfea7fc07a659ad07492e3524b1 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 8, 2026 22:44
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Nov 8, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh around line 136: with the queue on, prove_superseded can name a queue-landed Fast Gate run in another concurrency group as the evictor. The run then ends cancelled instead of failure. 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.md line 480 still says a push skips await-fast-gate whenever the variable is set. Consider adding the actor qualifier, or list it in the sibling sweep.

@bolichen97
bolichen97 merged commit a61bdbe into main Nov 8, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/15566-queue-actor-gate branch November 8, 2026 23:25
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: make the queue-on push path self-verifying (fall back to the full matrix when no merge_group run exists for the SHA)

2 participants