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:
More on Fundamentals and Pipeline Design
What is Continuous Integration (CI)?BeginnerWhat is the difference between Continuous Delivery and Continuous Deployment?IntermediateWhat is a CI/CD pipeline and what are its stages?BeginnerWhy should a pipeline "fail fast", and how do you order stages to achieve it?IntermediateWhat makes a build reproducible, and why does it matter?AdvancedHow does your branching strategy affect CI? Compare trunk-based development with GitFlow.Intermediate