Branch queues
Queues for every landing branch, nested queues carried by a pull request, and the stacks that fold into them.
On this page
Merget keeps one queue per branch that pull requests land into. The target branch's queue is the one The merge queue describes. This page covers the others: a queue for another landing branch of the repository, a queue nested under a pull request, and the stacks that fold into one. The queue page lists every live queue under Queues, the target branch's first; see Repository queue.
Merget can turn branch queues off for a repository. While they are off the repository has one queue, the target branch's: a pull request into any other branch is listed under Not in a queue as "Targets release/2.0, which no queue lands into"; a pull request into a protected integration branch that an open pull request merges into the target waits, outside the order, until that pull request merges; setting a stack to fold is refused ("this repository does not open nested queues"); and queues that were open retire on the next pass, their merge requests cancelled. The Branch queues settings are kept and apply again once branch queues are back on.
Queues for other landing branches
A pull request whose base is another branch of the repository — a release branch, develop — lands into a queue of its own for that branch, opened when the first such pull request appears and retired when nothing lands into the branch any more. A protected branch keeps its queue after a pull request from it merges — develop once its release pull request has merged into the target branch — and gets one again when a pull request targets it later. Which branches get one is the Branch queues setting: Default (automatic) and Every landing branch open one for any base, Only these branches only for a base that matches a pattern in Branches to queue, and a branch that Excluded branches match never has one — its pull requests are listed under Not in a queue with the reason. See Queue behavior and Pull requests outside the queue. If branch queues are switched off for the repository, every queue but the target branch's retires: a batch in one is abandoned before it lands and its merge request is cancelled; its pull requests are listed under Not in a queue.
Each queue is planned, prepared and landed on its own, with the rules the target branch's queue follows: order, predicted bases, batches, and Merge this sequence for its branch. Nothing moves between queues: a pull request is in the queue of its base, and retargeting it moves it.
If GitHub does not have a branch that pull requests are open into — it was never pushed, or it was deleted under them — that branch's queue alone stops: it says the branch does not exist on GitHub and what to do (push the branch, or retarget its pull requests onto a branch the repository has), the repository is listed as needing attention, and nothing lands into the branch until then. The target branch's queue and every other queue carry on.
A queue's batches are built on its own branch, so the CI that runs on a batch is that branch's: Merget pushes the batch commit (the branch with the batch's pull requests merged into it) to a temporary merget/queue/** branch, and GitHub runs the workflows of that commit whose push trigger matches merget/queue/** — the workflow files as the queue's branch holds them (see Make CI run on batch branches). With nothing required of the batch, Merget does not wait for CI to start when the batch commit holds no CI configuration and nothing but Merget reports on the batch's pull requests (see Required CI checks); their checks then name the queue's branch: "the batch commit on release/2.0 holds no CI configuration". The target branch may still have CI of its own. A queue nested under a stack set to fold is also held to the target branch's required checks; see Stacks that fold.
The landing controls on a queue's page act on that queue alone. Cancel stops the shown queue's merge request and never another queue's, and Merge the passing lane merges the shown queue's own passing lane into its branch. Merge anyway is offered on the target branch's queue only: a batch of another queue lands by that queue's own request once its CI passes.
Nested queues
A queue nested under a pull request is the queue of that pull request's own branch: the pull requests that land into the branch first, before the pull request — the queue's carrier — lands into the target branch. Merget opens one for a protected integration branch that an open pull request merges into the target, and for a stack set to fold (below).
On the queue page the carrier's row shows its nested queue as a collapsible list headed N PRs land into feature first · nested queue; expand it to read that queue's order, and use Merge N PRs into feature on its heading to land that queue's green sequence. The carrier's own check reads "Lands into main; the queue of feature (2 PRs) lands into it first." That sentence describes what is live, not an order Merget enforces: the carrier can merge first. When it does, a stack set to fold loses its nested queue: its pull requests are retargeted to the target branch and queued there, as a stack's children are when their parent merges. The pull requests of a protected integration branch stay on that branch, which keeps a queue of its own while pull requests still land into it: the nested queue itself while another open pull request still has the branch as its head, otherwise a new queue opened in the same pass (a merge request made in the nested queue must be made again there). Under a fold default (stacks.default_landing) they are retargeted as a fold stack's are, unless another open pull request still has the branch as its head.
Each landing into the branch moves the carrier's head, so the carrier is prepared again; its receipt lists that run under the cause nested_landing. A nested queue retires when its carrier merges or closes (unless its protected integration branch keeps its queue, above), when its branch stops being a queued base, when nested queues are switched off for the repository, when the Branch queues settings stop admitting its branch, or when its stack is set back to through. From the moment its carrier merges or closes until Merget's next pass over the repository, nothing lands into the branch; that pass retires the queue, or keeps it and lands again. Merget pushes nothing to a protected carrier's branch itself: a conflict of the carrier with the target branch is handed back to you, and so is an update that Require branches to be up to date before merging asks for. See A branch a queue lands into.
Illustration: this stack variant uses the billing and checkout pull requests to show parent-first landing and retargeting, and the same stack set to fold.
What to look for
- A child joins the queue when its base is a queued parent’s branch. It is ordered after its parent.
- In Queue and Autonomous modes, merging a parent retargets its child one level toward the target branch. Follow the child’s updated readiness and checks before merging.
- An eligible child behind its parent in the ready sequence can join its parent’s batch or a batch behind it; see the stack guide’s landing requirements. Otherwise it lands after its parent. Advisory mode does not retarget branches.
- A hand-chained stack set to fold lands the other way round: its children merge into the root’s branch first, through a nested queue of that branch, and the root then lands into the target branch carrying all of them.
Stacks that fold
A stack Merget inferred from base branches lands through by default: each pull request onto the target branch as its parent merges. See Stacked pull requests. Set to fold, the stack becomes a nested queue of the root's branch: the children land into that branch first, through that queue's own request, and the root then lands into the target branch as an ordinary pull request of the target's queue, carrying all of them. Choose fold when the root's branch is what you want tested and reviewed whole, or when its children should not be retargeted one by one. A conflict of the stack's root with the target branch is resolved on the root's branch as for any pull request; the fold queue's batches are then tested again over it.
A batch of the nested queue is held to the checks its branch requires and to those the branch the root lands into requires: a check main requires that fails on the batch stops it, even though the root's branch requires nothing, so nothing lands into the root's branch that the root could not then land with. The batch's request ends ("CI failed on the batch carrying #4"), and the child's check names the failing check. When neither branch requires a check, a failing check is optional and the batch lands past it, as on the target branch (see Required CI checks). While the root's branch itself fails such a check at its tip, Merget composes no batch over it again until the branch moves; the queue says why.
The repository's default landing style (stacks.default_landing) applies to every inferred stack; a stack set to through again stays through under a fold default. An agent sets the style of one stack with the set_landing action of merget_queue_action, naming the root (number) or the nested queue's branch (branch); see Operate Merget. The API routes are PUT …/queue/stacks/{number}/landing and PUT …/queue/landing. The change is recorded on the queue's timeline as "Landing set to fold (was through)" under the name of the person the agent acts for.
Fold is for inferred stacks only: a GitHub stack lands as GitHub lands it, a protected integration branch has its queue already, a root that is itself in a nested queue cannot fold (queues nest one level), and neither can a branch the Branch queues settings leave out. While a landing carries the root or one of its children, the change waits for it. Merge this stack is not offered on a fold root.
Look-through
A nested queue's pull requests are prepared against their own branch, so a finding on one says what it breaks there. Merget also reads each of them against the target branch's queue, over the landing its carrier is predicted to make: what the two would break in each other once the nested queue's branch lands into the target. These look-through findings are advisory on both ends — they block nothing and change no order — and Merget shows them where each side looks:
on the member's check, after its review clause: "when
featurelands: findings againstmain— see the run";on the check of the queued pull request they are read against: "when
featurelands: findings against this pull request — see the queue offeature";under Relationships on both queue pages, and in the findings document an agent reads, where each such finding carries
scopelook_throughand names the carrier and the branch it is read against.
The reading is on by default; queues.look_through turns it off for a repository. See Queue behavior.
Limits and caveats
Queues nest one level: a pull request in a nested queue cannot carry one of its own.
A branch queue that opened on its own —
developafter a release merged — stays a queue of its own when a new pull request from that branch opens: it is not nested under that pull request, and that pull request's check does not name it.A nested queue's pull requests are not stacked pull requests of the target branch's queue: they are not retargeted while their carrier is open, and the carrier does not wait for them unless you let it.
Look-through findings never block, in any mode, and dismissing one is the same as dismissing any other finding.
A fix or a conflict resolution submitted to Merget is taken for a branch or nested queue's pull request only where GitHub requires the Merget check on that queue's branch. The branch of a stack set to fold is not protected, so its batches and pull requests take none: push the fix to the branch.