Interview Prep/CI/CD/Fundamentals and Pipeline Design

What is a merge queue and what problem does it solve?

AdvancedConceptFundamentals and Pipeline Design
Answer

When many PRs are green individually, merging them in sequence can still break main, because each PR was tested against an older base ("semantic merge conflict"). A merge queue serialises merges: it builds a temporary branch containing the base plus all queued PRs ahead of yours, runs the required checks on it, and merges only if it passes.

GitHub merge queue needs the workflow to trigger on the merge_group event; GitLab has merge trains. Required status checks must run on both pull_request and merge_group, otherwise the queue stalls waiting for a check that never reports.

on:
  pull_request:
  merge_group:
All CI/CD questions Roadmap: CI/CD fundamentals

More on Fundamentals and Pipeline Design