Repository navigation
💡 Merge Queue Readiness: Systematic Prerequisites to Break the O(n²) Re-Review Deadlock #1939
Replies: 1 comment
Weekly UpdateWhat ChangedAsync Merge API GA (Oct 1, 2026): GitHub's async merge API reached general availability, providing a unified, recommended path to merge PRs individually, as stacks, or into a merge queue programmatically. This replaces the older synchronous REST/GraphQL merge calls. (GitHub Changelog, Oct 1 2026) This is directly relevant to the O(n²) re-review deadlock this idea describes: the async merge API supports programmatic merge queue enrollment, which means the PR-review pipeline could enqueue approved PRs into the merge queue via API rather than waiting for manual merge. Key capabilities:
Copilot Agent merge (preview, Sept 2026): GitHub's Copilot in VS Code now has "Agent merge" that autonomously handles review feedback, failed checks, merge conflicts, and workflow reruns — demonstrating the platform vendor's commitment to automated merge pipeline completion. Updated Assessment
RecommendationAdvance. The async merge API GA removes the last platform prerequisite for merge queue adoption. The suggested next step from the original idea — "systematic prerequisites audit" — should now include: (1) enabling the merge queue on the repo's ruleset, (2) wiring the PR-review pipeline's post-approval step to call the async merge API instead of waiting for manual merge, and (3) validating that the re-review behavior under merge queue is bounded (no O(n²) cascade). |
Uh oh!
There was an error while loading. Please reload this page.
Summary
The current merge pipeline forces a full re-review of every open PR on every merge to main, creating an O(n²) review loop that produced 154 forced re-reviews in 48 hours with zero merges (#1864). GitHub merge queue is the proven solution — GitHub's own monorepo processes 2,500+ PRs/month through it with a 33% reduction in wait-to-ship time. This idea systematically addresses the five prerequisites (#1871) blocking adoption: adding
merge_grouptriggers, migrating CodeQL to advanced setup, extending carry-forward verdicts, decoupling review validity from branch-freshness, and retiring the auto-rebase treadmill (#1881).Market Signal
GitHub reports 33% reduction in wait-to-ship time with merge queue. Industry data (Mergify study, 200K merges across 477 orgs) shows PRs that pass CI still break
main0.77% at 2-5 engineers and 12.5% past 40 engineers — underscoring merge queue value even for small teams. GitHub's May 2026 expansion of concurrency groups to 100 queued runs and third-party merge queue tools (Mergify, Trunk) offering priority lanes and per-label queue rules demonstrate the ecosystem is maturing. The Sep 2026 runner deprecation API also improves queue infrastructure visibility.User Signal
merge_group, CodeQL default setup cannotTechnical Opportunity
The engine's carry-forward mechanism (
scripts/lib/carry-forward.sh) already handles base-merge verdicts when the diff-vs-merge-base is unchanged (#1870); extending it to queue-rebased commits is incremental. CodeQL can be migrated from default setup to an advanced workflow that triggers onmerge_group. Theci-status.shgating logic already understands required vs non-required checks via ruleset queries. The auto-rebase workflow'smerge_groupawareness can be feature-flagged to ease the transition.Assessment
Adversarial Review
Strongest objection: CodeQL default setup cannot trigger on
merge_group(#1871), and switching to advanced setup requires ongoing manual rule maintenance that GitHub's default setup automates.Rebuttal: The CodeQL blocker is real but surmountable: advanced setup is GitHub's documented recommendation for organizations needing merge queue. The alternative — the current O(n²) re-review loop — costs more in forced re-reviews and human intervention than CodeQL rule maintenance ever would. Even partial progress (adding
merge_groupto the other four required checks) delivers value by narrowing the blocker to a single check.Suggested Next Step
Audit all five required-check workflows (SonarCloud, CodeQL, AgentShield, dependency-audit, duplicate-decl-gate) for
merge_groupreadiness; prototype a CodeQL advanced-setup workflow with the current rule set as a spike to validate feasibility and maintenance burden.All reactions