Skip to content

ci: merge queue + content-addressed gate skips - #449

Merged
athvin merged 1 commit into
mainfrom
ci/merge-queue-and-content-skip
Nov 5, 2026
Merged

athvin merged 1 commit into
mainfrom
ci/merge-queue-and-content-skip

Conversation

@athvin

@athvin athvin commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Why

Rebasing a green PR re-runs the full backend gate (~40 min) even when main only moved through paths that gate never reads. This change attacks that two ways.

What

1. Merge queue support. rust, frontend and infra now trigger on merge_group. In the queue, each detect job applies its existing path filter to merge_group.base_sha...head_sha, which is the exact tree that will land.

  • bench-compile and scale-tests don't run on queue events.
  • infra's plan skips in the queue, and plan-gate accepts that skip (the PR already ran its plan).

2. Content-addressed skip on PRs. rust and frontend detect compute a pass key: a hash of the tested merge-commit tree over every path the gate reads (they reuse the filter's own regex, so the two can't disagree), plus the ISO week. If a matching ci-pass-* cache marker exists, the required jobs skip through the existing if: mechanism. The new record-pass job writes the marker only after every required job succeeds.

  • Markers are scoped to the PR's ref, so a PR can only skip on a result it produced itself.
  • push and merge_group runs never read markers, so the queue always re-proves the result.
  • Markers expire weekly, which bounds inputs the key can't see (floating stable rustc, advisory databases).
  • Adding the ci:full label forces a full run.

Settings to change after merge (repo admin)

  1. Enable the merge queue on main, in the branch ruleset or classic protection.
  2. Turn off "Require branches to be up to date before merging".
  3. Create a ci:full label (optional).

Merge this before enabling the queue. Until these workflows have merge_group: on main, queued PRs would wait forever for required checks.

Verified

  • actionlint is clean on all three workflows.
  • Key script tested locally: the Rust key stays the same after a Terraform-only or .claude-only change and changes after a rust/ change.
  • scripts/skills-check.sh all passes.

Generated by Claude Code

Rebasing a green PR re-ran the full ~40-minute backend gate even when main had
only moved through paths the gate never reads.

- rust, frontend, infra trigger on `merge_group`; each `detect` applies its
  usual path filter to the queue's base...head. bench-compile/scale-tests
  exclude the event; infra's `plan` skips there (plan-gate accepts it).
  With this, "require branches to be up to date" can be turned off.
- rust and frontend `detect` compute a pass key on PRs: hash of the tested
  tree over the paths the gate reads (reusing the filter's own regex) plus
  the ISO week. A hit on a `ci-pass-*` marker that `record-pass` wrote after
  every required job succeeded skips the gate. Markers are PR-ref-scoped,
  never consulted on push/merge_group, and `ci:full` forces a full run.
- ci-and-supply-chain skill documents both; required-checks.md regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MFnHDSnn8QX7CPfzgffdf4
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

terraform plan

93df596 · run log and full plans

env add change destroy
state-backend (plan only) 0 0 0
core 0 0 0
dev 0 0 0
prod 0 0 0

Planned with -refresh=false, so this is the config-versus-state diff and
not out-of-band drift. That is a security choice, not a speed one: a refreshing
plan reads secret values, and the plan role is assumable from any PR branch —
which can edit the workflow it runs under. Drift is caught at apply time, which
refreshes fully.

@athvin
athvin merged commit f3b7f9f into main Nov 5, 2026
42 checks passed
athvin added a commit that referenced this pull request Nov 5, 2026
…ts limit (#495)

`skills-check` fails on `main`: the `ci-and-supply-chain` body is 521 lines
against a 500-line authoring limit, so every PR inherits a red gate.

#449 is where it crossed — the "Merge queue and content-addressed skips"
section took the body from 498 to 521. Nothing is wrong with that section;
the body was simply one addition away from the limit and nobody was holding
the budget. It is the same shape as the `entities-index` count going stale
twice: a per-PR check that passes on each branch and not on the merge.

Fixed by moving the 110 lines about **agentic workflows** out to
`references/agentic-workflows.md`, which is what the limit is for rather than
a way around it. That subsystem is the right thing to move: all four `gh-aw`
workflows and `agent-task.yml` are merged and DISABLED — `engine: copilot`
needs a real `COPILOT_GITHUB_TOKEN`, the repo has no secrets, so every
trigger died at `activation`. This skill loads at the start of any session
touching CI, and 110 lines about a subsystem that cannot currently run is
exactly the detail that belongs one hop away.

The body keeps a seven-line statement of the disabled state and that the
workflows fail *closed*, which is the part a reader needs without following
the link, and points at the reference for re-enabling them, the safe-output
boundary, the `sccache` env that must match `rust.yml` byte-for-byte, and the
disk-reclaim step that must not be copied.

Verified the moved text is byte-identical to what was removed, modulo one
heading level. Body now 424 lines; `skills-check: ok` over 19 skills.

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants