Sub topic 7
Choosing queue settings
This chapter assumes you can write GitHub Actions workflows, you know how required status checks work, and you have already enabled a merge queue on a branch or ruleset. Here you will pick values for the settings that control how the queue builds and merges pull requests.
What the settings control
Each setting trades speed against CI cost and risk. The queue reads them from the branch protection rule or the ruleset that enables it.
| Setting | JSON field | What it controls |
|---|---|---|
| Merge method | `merge_method` | `MERGE`, `SQUASH`, or `REBASE` for entries in the queue |
| Build concurrency | `max_entries_to_build` | How many merge groups are tested at the same time |
| Maximum group size | `max_entries_to_merge` | The most pull requests merged in one group |
| Minimum group size | `min_entries_to_merge` | The fewest pull requests the queue will merge together |
| Wait time | `min_entries_to_merge_wait_minutes` | How long the queue waits for the minimum group size before merging a smaller group |
| Status check timeout | `check_response_timeout_minutes` | How long the queue waits for required checks before it counts the group as failed |
| Grouping strategy | `grouping_strategy` | `ALLGREEN` or `HEADGREEN`: whether every entry's checks must pass |
Merge method
Choose the method your repository already uses. Squash keeps one commit per pull request on main, which makes history easy to read and revert. A merge commit keeps the full branch history. Rebase keeps individual commits but rewrites them. The queue applies this method when it builds each merge group, so changing it affects what the checks test.
Concurrency and group size
These two settings set your throughput.
- Build concurrency lets the queue test several merge groups in parallel. Each group is built on top of the one ahead of it, so a failure in an earlier group forces later groups to rebuild.
- Group size lets one CI run cover several pull requests. A group of five costs one run instead of five, but if it fails, the queue must work out which pull request caused the failure.
With a concurrency of 5 and a group size of 1, up to five runs are active at once and each pull request gets its own result. With a concurrency of 1 and a maximum group size of 5, there is one run at a time and a failure points at a batch.
Wait time and timeout
The minimum group size and the wait time work together. If you set a minimum of 3 and a wait of 5 minutes, the queue holds a lone pull request for up to 5 minutes, hoping others arrive. After that it merges whatever it has. Set the minimum to 1 if latency matters more than saving CI runs.
The timeout should be longer than your slowest required check, with some margin. If it is too short, healthy groups get removed. If it is too long, a hung job blocks everything behind it.
Grouping strategy
ALLGREEN requires every entry's checks to pass before the group merges. HEADGREEN only requires the last entry's checks to pass, since that commit includes all earlier ones. The next chapter covers failure behavior in detail. For now, treat ALLGREEN as the safer default.
Example starting point
This ruleset rule suits a team with a 10-minute test suite and moderate traffic:
{
"type": "merge_queue",
"parameters": {
"merge_method": "SQUASH",
"grouping_strategy": "ALLGREEN",
"min_entries_to_merge": 1,
"max_entries_to_merge": 5,
"min_entries_to_merge_wait_minutes": 5,
"max_entries_to_build": 5,
"check_response_timeout_minutes": 60
}
}Start here, then adjust from observed queue times and CI bills.
Exercise
Your team has a 40-minute test suite, merges about 30 pull requests a day, and CI minutes are expensive. Which direction would you move group size and concurrency, and why?
Show answer
Raise the maximum group size so one 40-minute run covers several pull requests, which cuts total CI minutes. Keep concurrency moderate, because each parallel build is a full 40-minute run that is wasted if an earlier group fails. Also set the timeout above 40 minutes, for example 60.