Skip to content
Latchkey

What Is a Merge Queue?

A merge queue is a system that lines up approved pull requests and merges them one at a time, re-running CI on each against the up-to-date target branch before it lands. This prevents the situation where two PRs each pass independently but break when combined. It keeps a busy main branch continuously green without manual rebasing.

Why it matters

On high-traffic repos, a PR that was green an hour ago may conflict logically with what merged since. A merge queue tests the actual post-merge state for each change, catching these semantic conflicts. The trade-off is more CI runs, which fast, autoscaled runners help absorb.

Related concepts

  • Tests each PR against the current target branch
  • Prevents semantic conflicts between independently green PRs
  • Increases CI load, favoring autoscaled runners

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →