Skip to content

Commit c1457bf

Browse files
ci: make the merge queue the only path to main (#97)
* ci: make the merge queue the only path to main Document the active main ruleset (ci-ok, no direct pushes, no release-bot bypass) so every landing commit goes through merge_group. Co-authored-by: Cursor <cursoragent@cursor.com> * ci: retrigger checks with a valid Budget effect note Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d5fe64b commit c1457bf

6 files changed

Lines changed: 26 additions & 13 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: CI
22

3+
# The repository ruleset on main requires the merge queue and the ci-ok check from this
4+
# workflow. merge_group is the landing proof; pull_request is feedback; push to main is
5+
# post-merge (and still re-runs the gate until a follow-up thins it). See MAINTAINERS.md.
6+
37
on:
48
pull_request:
59
push:

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ While you work, `npm run check:fast` answers in under a minute: it builds, then
9696

9797
CI also enforces test coverage floors (93% lines, 87% branches, 93% functions) with `npm run test:coverage`. New code should come with tests so the number stays up; raise the floors in `package.json` when coverage rises, never lower them to make a change pass.
9898

99-
The pull request gate GitHub enforces is one status check, `ci-ok`. It runs after every other CI job and fails when any of them failed or was cancelled; a skipped job counts as passing. Only `ci-ok` is required by branch protection, so the jobs behind it can change without editing repository settings. Maintainers enable the merge queue in [MAINTAINERS.md](MAINTAINERS.md#branch-protection-and-the-merge-queue).
99+
The pull request gate GitHub enforces is one status check, `ci-ok`, and the merge queue is the only path onto `main`. `ci-ok` runs after every other CI job and fails when any of them failed or was cancelled; a skipped job counts as passing. Only `ci-ok` is required in the ruleset, so the jobs behind it can change without editing repository settings. Details: [MAINTAINERS.md](MAINTAINERS.md#branch-protection-and-the-merge-queue).
100100

101101
### Optional pre-push hook
102102

‎GOVERNANCE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ There is no steering committee or formal vote. The current maintainer grants mai
2828

2929
Most decisions are made in the issue or pull request where the work happens. Contributors argue for an approach with evidence, tests, and a working change; the maintainer decides when discussion does not settle it. There is no vote count and no requirement that every objection be withdrawn, only that it be answered.
3030

31-
Every merge needs a green `npm run check` and resolved review conversations. CI also runs the rules check on changed registry files and the self-scan that fails on findings outside the baseline. The branch protection rule on `main` requires one status check, `ci-ok`, which fails when any CI job failed or was cancelled and passes when a job was skipped; the merge queue runs it on `merge_group` before a pull request lands. The rule does not require an approving review. Review is therefore a convention the project keeps, not a gate GitHub enforces: a change to the paths in `.github/CODEOWNERS`, to lifecycle evidence, or to a public contract waits for the code owner, and green CI is not a substitute for that review.
31+
Every merge needs a green `npm run check` and resolved review conversations. CI also runs the rules check on changed registry files and the self-scan that fails on findings outside the baseline. The repository ruleset on `main` requires the merge queue and one status check, `ci-ok`, which fails when any CI job failed or was cancelled and passes when a job was skipped; the queue runs it on `merge_group` before a pull request lands. Direct pushes to `main` are closed. The ruleset does not require an approving review. Review is therefore a convention the project keeps, not a gate GitHub enforces: a change to the paths in `.github/CODEOWNERS`, to lifecycle evidence, or to a public contract waits for the code owner, and green CI is not a substitute for that review.
3232

3333
### When a written decision is required
3434

‎MAINTAINERS.md‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ Library maintainers who ship CLE lifecycle declarations for *their* packages: se
1212

1313
## Branch protection and the merge queue
1414

15-
`main` requires one status check, `ci-ok`. The CI workflow reports it after every other job, and it passes when each needed job succeeded or was skipped; it fails when any of them failed or was cancelled. Keep the individual jobs, and the public-corpus run, out of the required list so the matrix can change without editing repository settings.
15+
`main` accepts commits only through the merge queue. The repository ruleset named `main` (Settings → Rules → Rulesets) requires:
1616

17-
The merge queue is part of the same rule and runs CI on `merge_group` before it lands a pull request. To turn both on for a repository: **Settings → Rules → the `main` rule → Require status checks to pass**, add `ci-ok`, then enable **Require merge queue** and pick the merge method and grouping. The `merge_group` trigger in `.github/workflows/ci.yml` is what gives the queued pull request its `ci-ok`; without it a queued pull request waits forever.
17+
1. A pull request (no direct pushes).
18+
2. The single status check **`ci-ok`**.
19+
3. The merge queue (squash; up to five entries built and merged together; 45-minute check timeout; `ALLGREEN`).
20+
21+
`ci-ok` is reported by [`.github/workflows/ci.yml`](.github/workflows/ci.yml) after every other job in that workflow. It passes when each needed job succeeded or was skipped, and fails when any of them failed or was cancelled. Keep the individual jobs, and the public-corpus run, out of the required list so the matrix can change without editing the ruleset. The `merge_group` trigger in that workflow is what gives a queued pull request its `ci-ok`; without it a queued pull request waits forever.
22+
23+
### Release-bot exception
24+
25+
There is none. The ruleset has an empty `bypass_actors` list, so no actor (including admins and GitHub Actions) may push past the queue onto `main`. Release workflows do not need a bypass: they push to `release/<tag>` (Action bundle), floating major tags, and the `badges` branch — never to `main`. A release commit reaches `main` the same way as any other change: through a pull request and the merge queue.
1826

1927
## Detector owners
2028

‎docs/CI.md‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ every needed job succeeded or was skipped. Keep individual jobs, the public corp
2323
fuzz, mutation, and package smoke **out** of the required list so the matrix can change without
2424
editing repository settings.
2525

26-
How to turn the check and the merge queue on: [MAINTAINERS.md](../MAINTAINERS.md#branch-protection-and-the-merge-queue).
26+
The ruleset and the merge queue are on; details and the (absent) release-bot exception: [MAINTAINERS.md](../MAINTAINERS.md#branch-protection-and-the-merge-queue).
2727
Contributor-facing note: [CONTRIBUTING.md](../CONTRIBUTING.md#quality-standards).
2828

2929
## Lanes at a glance
@@ -135,24 +135,25 @@ the site instead.
135135
**Rules.**
136136

137137
- Never cancel a `merge_group` run for a newer push.
138-
- The merge queue is the only path to `main` once #2029 is done; until then, treat a green queue
139-
run as the intended proof even if direct merges still exist.
138+
- The merge queue is the only path to `main` (repository ruleset; see
139+
[MAINTAINERS.md](../MAINTAINERS.md#branch-protection-and-the-merge-queue)).
140140
- Do not put corpus, mutation, or Scorecard into the queue budget.
141141

142142
## Main (15 minutes)
143143

144-
**Goal.** After the merge queue is the only path, do not re-prove the same gate on every push.
144+
**Goal.** The merge queue is the only path, so do not re-prove the same gate on every push.
145145

146-
**Target (after #2029 and #2030).**
146+
**Target.**
147147

148148
- Badge publish to the `badges` branch.
149-
- Pages deploy **once per merge batch**, not once per commit (#2031).
149+
- Pages deploy **once per merge batch**, not once per commit.
150150
- Any remaining release-branch Action bundle build the release chain still starts from `main`.
151151
- Do not cancel a `main` run that is the only verification left for a commit. Report cancelled
152152
share; keep it under 5%.
153153

154-
**Until the queue is enforced.** Keep the full `ci.yml` gate on `push` to `main` so history stays
155-
covered. That transitional cost is accepted; removing it is #2030's job after #2029.
154+
**Today.** The full `ci.yml` gate still runs on `push` to `main` as a belt-and-suspenders check
155+
while post-merge jobs (badges, Pages) share that workflow. Thinning `main` to side effects only
156+
stays a follow-up; the queue is already the landing proof.
156157

157158
## Nightly and scheduled (60 minutes per workflow)
158159

‎docs/PARALLEL_WORK.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Three causes, 8 conflicting tasks. `examples/capabilities.json` is an assembled
4646
## What this does not show
4747

4848
- The tasks are replayed from history, not started fresh from one base, so some conflicts are really dependencies (the later task was written on top of the earlier one). The causes above are the shared paths either way.
49-
- The merge queue is not on (#2029 is open), so the merges were local `git merge` runs, not queue runs.
49+
- When this experiment ran, the merge queue was not yet on, so the merges were local `git merge` runs, not queue runs. The queue is now the only path to `main` (see [MAINTAINERS.md](../MAINTAINERS.md#branch-protection-and-the-merge-queue)).
5050
- Rerun this experiment after each cause is fixed. The goal stays zero textual conflicts.
5151

5252
## After the fix for hard-coded counts (#2581)

0 commit comments

Comments
 (0)