MergeRamp / Guides / Field Guide 09
Both PRs passed, main still broke
Two approved changes can work on their own and fail together. A merge queue gives your checks a chance to catch that interaction before it reaches main.
It’s the end of a review session. Two pull requests have approval, both have passed CI, and their authors are ready to move on. The first merges. The second follows a few minutes later. Then the build on main fails.
Everyone checked their own work. Now someone has to interrupt what they were doing, find the interaction, and decide which change to fix or revert. The green checks made both merges look routine.
Two changes that work separately
Consider an example. One PR renames an account field from email to emailAddress. It updates the existing callers and their tests. Meanwhile, another developer adds a CSV export that reads the old email field.
The rename passes against main without the new export. The export passes against main before the rename. The files merge cleanly, but the combined code no longer agrees on the field name. A build or test that covers that interaction can now fail.
This is an illustrative example, but the pattern applies whenever changes depend on shared behavior. Git can combine the text successfully while the application still breaks.
A passing check belongs to a version of the code
CI tested the code it received at a particular point in time. A passing result gives you evidence about that version and the behavior your checks cover.
Once another PR lands, main has changed. The second PR’s earlier result does not establish that the new combination works. In the example, the missing step was running the export with the renamed field before both reached main.
You can require branches to be up to date before merging. GitHub’s strict required-check setting makes that a merge requirement; loose checks allow branches to merge without being current. GitHub explains the tradeoff between strict and loose checks.
The team starts taking turns
A careful team can handle this manually. One developer announces they’re merging. The next updates their branch, waits for checks, and merges when the result is green.
That arrangement can work well when merges rarely overlap. As more PRs become ready together, keeping the order takes attention. Someone has to watch whether main moved during CI and decide who goes next.
A developer who finished a change is still responsible for getting it through the last few minutes of the process. The work shows up as repeated branch updates, messages asking whose turn it is, and another check of the merge button.
A merge queue can solve the coordination problem
A merge queue organizes ready PRs and coordinates validation against the changes they will join. In the field-renaming example, it gives CI the opportunity to catch the incompatible export before both changes reach main.
In a serial approach, the first candidate is validated against the current base. After it merges, the next candidate is brought current and checked in turn. Other implementations validate combinations ahead of time or group changes into batches.
GitHub’s native queue uses temporary branches to test a candidate with the latest base and queued changes ahead of it. Its documentation describes how it handles passing and failing groups. Read how GitHub’s merge queue works.
The tests still need to detect the problem. If nothing checks the CSV export, an incompatible change may pass through a queue too. The queue coordinates which code gets tested; test coverage determines what those checks can catch.
Auto-merge can still be part of this workflow. It completes a PR once its requirements are satisfied. Our auto-merge versus merge queue guide explains how the two fit together.
Manual coordination has a cost
You do not need a broken main branch to justify considering a queue. Your developers may already be preventing those failures by coordinating every merge themselves.
Look back over a typical week. How often did a ready PR need another update because main moved? How often did someone wait for another author to merge? Was a developer keeping track of the order in chat?
If those moments are rare, your existing process may be sufficient. If they repeatedly pull people back into finished work, a queue is worth evaluating. The potential benefit includes less time spent managing the handoff between approved code and main.
Choose a queue that fits your merge traffic
Start with your workload. A serial queue processes one candidate at a time, so required-check duration affects how quickly it can clear the line. Teams with long pipelines or concentrated bursts of merges should evaluate that capacity before adopting one.
MergeRamp focuses on serial coordination around GitHub’s auto-merge workflow. For private repositories on GitHub Team, our guide to merge queue options covers the approaches to consider.
When you try a queue, bring two interacting PRs through it. Watch what gets tested after the first change advances, and confirm a failing combination stays out of main. That is the handoff the two green checks in our example were missing.