Repository navigation
Description
Problem
Nothing in v2/main's ruleset tests a PR against the tip it merges into. The live ruleset v2/main: PRs only has three rules (no deletion, no force-push, changes by pull request with zero required approvals) and no required status checks at all: a PR's CI is green at merge by convention, not by enforcement, and it is never required to have run on the combined tree.
On 2026-11-18 two PRs that were each green merged minutes apart and left v2/main red (#5569). The procedural answer is #5589. This issue is the question of whether to enforce it.
Options to evaluate
- A merge queue on
v2/main. GitHub builds the combined tree and runs the required checks on it before merging, so no PR needs a catch-up push. It needs: amerge_grouptrigger on every workflow whose jobs become required (none has one today), the required checks named in the ruleset, a decision on the queue's merge method (this repo merges with merge commits), and a check that the DCO job, the interface diff and the dispatched-run reporter jobs behave on amerge_groupevent.pr-flowstep 10,AGENTS.mdanddocs/quality-gate.mdchange to match, as does how the Version Packages and Prepare Python Release PRs merge. - Required status checks with "require branches to be up to date". Simpler to switch on, but every merge makes every other open PR stale, and each catch-up is another gate run and CI run. It costs the most exactly when several PRs are open at once.
- Required status checks without the up-to-date requirement. Does not close this gap, but would turn "CI is green at merge" from a convention into a rule. Worth deciding on its own.
- Leave the ruleset as it is and rely on pr-flow: catch up and re-test before merging when v2/main moved under the PR #5589 plus CI on the push to
v2/main, on the grounds thatv2/mainis a develop branch and nothing publishes from it without a milestone merge PR that runs CI again.
Done when
A decision is recorded here with its reasoning. If it is a change, the ruleset, the workflows, AGENTS.md (Project status and direction describes this ruleset), pr-flow and docs/quality-gate.md change together, in a follow-up issue if the work is more than one PR.
Note
A ruleset change is a maintainer's act in the repository settings; it is not something a PR or an agent applies.
Activity
cliffhall commentedon Nov 18, 2026
Research for the decision (nothing was changed)
Everything below was read from the API on 2026-11-18, at
v2/main=7f383a8e. No ruleset, setting or workflow was touched.Current state
Rulesets that apply
v2/mainv2/main: PRs only(24968529)mainmain: milestone merges only(24866866)Source is v2/main(GitHub Actions), not strictmainL3 - full protection(org 2749948 and repo 3187904),Copilot review for default branch(20596567)Repository settings: merge commits and rebase allowed, squash off, auto-merge on, "update branch" on, head branches deleted on merge. The org is on the Enterprise plan and the repository is public. No classic branch protection exists on either branch.
What runs on a PR.
typescript.ymlandpython.ymltrigger onpush(any branch) andworkflow_dispatch, notpull_request;dco.ymlandeverything-mcp-diff.ymltrigger onpull_request. No workflow has amerge_grouptrigger. Every PR runs every server: 34 to 51 check runs per head (37 typical), and the job names are matrix-generated (Validate memory (Node 26),Test git (Windows), ...). The automated version PRs get CI throughworkflow_dispatch, mirrored as four commit statuses (TypeScript (dispatched),Python (dispatched),DCO (dispatched),Interface diff (dispatched)).How long it takes. Over the last 45 maintainer PRs merged into
v2/main, wall time from first job start to last job end: median 238 s, p90 344 s, max 696 s.Test git (Windows)is the usual long pole at 4 to 5 minutes. One full run is about 43 job-minutes (2,581 s over 37 jobs on the sampled head). Standard runners are free on a public repository, so the cost is latency and runner concurrency, not money.Is "green at merge" already true? Yes. Of those 45 PRs, none merged with a failed or unfinished check on its head. (Three show a cancelled
DCO signoff, each a duplicate superseded by a later run that passed.)How often
v2/mainmoves under a PR. Since the ruleset was created (2026-10-12), 200 PRs merged in 37 days:Did that produce a red
v2/main? Once that the record shows:aef8fd72(this issue's incident, #5569), red from 05:48 to 06:04 UTC, 16 minutes, repaired in #5571. The two other failed push runs onv2/mainin the window were not combined-tree failures:d1b59ba8(a Windows filesystem test on a PR that was up to date; a timeout later addressed by #5331) and one Version Packages workflow failure atb6bb2f65.A caveat the issue's fourth option depends on. "CI on the push to
v2/main" does not run to completion on most commits.typescript.ymlandpython.ymlcancel a superseded run on the same ref everywhere exceptmain, so in a burst each merge cancels the previous one's run. Of 203v2/maintips in the window, 98 had both workflows finish, 20 had one, and 85 had neither. Only the last commit of a burst is reliably tested. A break persists into that last commit, so it is still found, but later and without saying which merge caused it.What a red
v2/maincosts here. Nothing publishes from it. The cost is that the local gate runs every server, so every worktree cut from a red tip has a red gate that is not its own doing, for every agent working at the time.The options
A. Merge queue on
v2/mainMerge pull request #Ncommits.merge_group:ontypescript.ymlandpython.yml(GitHub's docs say a required check that does not report on the merge group fails the merge). Required checks are matched by name and the matrix names change whenever a server or Node leg does, so each workflow needs one aggregate job (if: always(), fails unless every needed job passed or was skipped) to be the required context. IfDCO signoffor the interface diff were made required they would need amerge_grouppath too; both readgithub.event.pull_request.*, so the simplest course is to leave them unrequired.AGENTS.md(Project status and direction, and the merge steps under Issue-driven work style),pr-flowstep 10,release(version PRs),security-advisory(the public fix PR),docs/quality-gate.md. The pr-flow: catch up and re-test before merging when v2/main moved under the PR #5589 procedure becomes redundant.mainand the milestone merge PR: unaffected. The queue rule lives in thev2/mainruleset only; the merge PR intomainstill merges directly with a merge commit, andSource is v2/mainstill holds because queue-made merge commits are ordinaryv2/maincommits.v2/mainregenerates it (new head, rewritten body). If it sits in the queue behind another PR, that PR's merge regenerates it and it is ejected. It has to be enqueued when the queue is empty, and "Part of #Nimmediately before merging" becomes "immediately before enqueueing, re-checked after merge". The Prepare Python Release PR has no such problem.pushtrigger also fires ongh-readonly-queue/**branches, which would double every queue run unless excluded.v2/mainwould re-test a tree the queue already tested.v2/mainfrom any combination of PRs, including bursts seconds apart. Does not prevent: flaky tests (they eject PRs instead), or anything CI does not check.B. Required checks with "require branches to be up to date"
merge_group.AGENTS.mdrequires the local gate before every push, so each catch-up is also a gate run under the machine-wide lease, unless the rule gains an exception for the server-side "update branch" merge.C. Required checks without it
D. Status quo plus the #5589 procedure
AGENTS.mdandpr-flowonly (pr-flow: catch up and re-test before merging when v2/main moved under the PR #5589, in progress).Recommendation
typescript.ymlandpython.yml, themerge_grouptriggers added but inert, the ruleset's required checks trialed in Evaluate mode first, and the version-PR question settled on a real version PR.The case for stopping at step 2 is real: one combined-tree break in 200 merges, repaired in 16 minutes, on a branch nothing publishes from. The case for going to step 4 is that 75% of merges here already land on a moved base, they land in bursts that a check-then-merge procedure cannot serialize, a red tip fails every concurrent agent's gate, and the queue's latency is paid by machines. I recommend going to step 4, in stages.
Questions for the maintainer
DCO signoffand the interface diff? Each extra required check needs amerge_grouppath under A and a dispatched-run equivalent on the version PRs.Part of #Nstep moving to just before enqueueing?cliffhall commentedon Nov 18, 2026
Decision (maintainer, 2026-11-18): option D, the procedure alone.
v2/mainkeeps its current ruleset: no merge queue and no required status checks. The protection against a combined-tree break is the catch-up-and-re-test rule and thepr-flowstep 10 procedure from #5589 (PR #5616).The analysis above stays as the record of what was measured and what the other options would cost, should this be revisited. A (merge queue), B (required checks with up-to-date branches) and C (required checks only) are not being adopted.