|
|
|
|
|
by lhorie
1075 days ago
|
|
Merge queues are, as the name implies, queues for pull requests/merges. They're kinda useless if your commit traffic is low (e.g. <10 per day), but become necessary once it grows past your daily CI time budget, roughly (which can happen on large monorepos). As a very simple example, if your CI takes 10 minutes, your CI time budget is 6 merges per hour. This is because if you merge two things in parallel without validating CI for the combined changes, your main branch could end up in a broken state. Merge queues run CI for groups of PRs. If the group passes, all the PRs in the group land simultaneously. If it does not, the group is discarded while other group permutations are still running in parallel. This way you can run more "sequential" CI validation runs than your CI time budget allows. In our monorepo, we get a volume of 200-300 commits per day with CI SLO of 20 mins. Without a queue, our best case scenario would be getting capped at ~72 commits per day before seeing regressions on main despite fully green CI (in real life, you'd see regressions a lot earlier though because throughput of PRs is spiky in nature) |
|
That is a way of handling even higher volumes than GitHub is talking about, at the cost of a system that is a bit harder to think about. From the article:
With GitHub’s merge queue, a temporary branch is created that contains: the latest changes from the base branch, the changes from other pull requests already in the queue, and the changes from your pull request. CI then starts, with the expectation that all required status checks must pass before the branch (and the pull requests it represents) are merged.