Merge queue
A merge queue tests each pull request against the latest branch plus the changes queued ahead of it, then merges in order. How it works and why CI must opt in.
A merge queue is a feature of a Git hosting provider that merges pull requests into a busy branch one group at a time, after testing each against the latest state of that branch and the changes queued ahead of it.
What it is
Two pull requests can each pass CI on their own and still break the branch once both are merged. A merge queue closes that gap. On GitHub (Managing a merge queue):
- Pull requests join the queue in order.
- For each, GitHub builds a temporary branch with the latest base branch plus the pull requests ahead of it.
- Required checks run on that combined state, and the change merges when they pass.
- If checks fail or the group conflicts, that pull request leaves the queue and the rest are rebuilt without it.
CI must run on the merge_group event for this to work:
on:
pull_request:
merge_group:
An administrator turns it on with Require merge queue in the branch's protection rule.
Why it matters
The busier a branch is, the more often "green on its own" stops meaning "green when merged". Teams that let AI agents open many small pull requests hit this sooner.
In AI CodeOps
AI CodeOps doesn't run a merge queue or handle merge_group events. Its release gate judges a pull request on its own checks and findings.
Frequently asked questions
Why do my required checks never finish in the queue?
On GitHub, CI has to run on the merge_group event as well as pull_request. Without it, the checks are never reported for queued pull requests and the merge fails.
Does AI CodeOps support merge queues?
No. It doesn't add pull requests to a queue or listen for merge_group events.