Sub topic 14
How the built-in queue compares with other tools
This chapter assumes you have read the earlier chapters. You should know how merge groups, the merge_group trigger, and queue settings work. You should also be comfortable with branch protection and GitHub Actions.
What you are comparing
The built-in merge queue is one of several ways to keep main green. Each option answers the same question: how do you test a change against what main will look like when it lands? The options differ in where the logic runs, how much they can be tuned, and what they cost to operate.
Alternatives to the built-in queue
Require branches to be up to date
Branch protection can require every pull request to be current with the base branch before merging. This is the simplest option, and it needs no new workflow triggers. It breaks down on busy repositories. Each merge makes every other open pull request stale. Authors must update their branches and wait for CI again, and the next merge can make them stale a second time. Merges become serial and manual.
Auto-merge
Auto-merge merges a pull request once its requirements pass. It saves a click, but it does not test the pull request against the other changes landing around it. Without the up-to-date requirement, it has the same stale-main weakness described earlier in this tutorial.
Third-party queue services and bots
Services such as Mergify, Aviator, Graphite, and Trunk, and bots such as Kodiak, run outside GitHub's merge queue and are configured separately. They often offer features the built-in queue lacks, such as priority lanes, custom batching rules, or speculative builds. Their feature sets change often, so check each tool's current documentation before you decide.
Their costs are an extra vendor or app to trust with repository write access, a second configuration system, and a dependency on an external service for merging.
Merge trains in other platforms
GitLab's merge trains work on the same idea as GitHub's queue. Each merge request is tested against the target branch plus the requests ahead of it. If you work across both platforms, the mental model carries over. The configuration does not.
Side-by-side view
| Approach | Tests against changes ahead? | Extra setup | Main weakness |
|---|---|---|---|
| Up-to-date requirement | No, only the current base | None | Constant rebasing and repeated CI |
| Auto-merge | No | None | Stale-base failures |
| Built-in merge queue | Yes | `merge_group` trigger, ruleset | Fewer tuning options |
| Third-party queue | Yes, tool-dependent | App install, own config | Extra vendor and permissions |
Choosing
Start with the built-in queue when your needs fit its settings: merge method, group size, build concurrency, and timeout. It is part of the platform, so there is no extra permission grant. It also uses the same rulesets and required checks you already manage.
Consider a third-party tool only when you can name a specific gap. Examples are custom prioritization, or rules that depend on file paths or labels. Without a named gap, you are paying for complexity you do not use.
Migrating
If you move from a bot to the built-in queue, do it in this order:
- Add the
merge_grouptrigger to every workflow that provides a required check. - Create the ruleset or branch protection rule that enables the queue.
- Remove the bot's merge permissions so two systems do not compete.
- Tell contributors how to add pull requests to the queue.
Exercise
A team merges about five pull requests per week, and CI takes four minutes. A colleague proposes installing a third-party queue service. What would you recommend first, and what evidence would change your mind?
Show answer
Recommend requiring up-to-date branches, or the built-in queue if stale-base breakage actually happens. At five merges a week, a pull request rarely goes stale, so a third-party service adds cost and permissions for little benefit. Changing the recommendation would need a specific gap that the built-in queue cannot cover, such as custom prioritization rules, or evidence of frequent broken main builds.