Merge Schedules
How the merge queue tests a pull request before its merge schedule opens, and how it keeps that pull request from holding up the ones that can merge now.
A queue rule can limit when its pull requests merge with a
schedule in its merge_conditions.
Outside that window, a pull request’s merge schedule is closed: it stays in the
queue and does not merge, however green its checks are. Mergify tests it ahead
of the window, so it merges as soon as the window opens, and keeps it from
holding up the pull requests that can merge now.
When to use merge schedules
Section titled When to use merge schedulesUse one when some pull requests should only land at certain hours, such as dependency updates while someone is around to watch them deploy.
Setting up a merge schedule
Section titled Setting up a merge scheduleAdd the schedule to the merge_conditions of the queue rule that should wait:
queue_rules: - name: dependencies queue_conditions: - author = dependabot[bot] merge_conditions: - check-success = ci - or: - label = hotfix - schedule = Mon-Fri 09:00-11:00[Europe/Paris] - name: default merge_conditions: - check-success = ciHere, dependency updates merge on weekday mornings, unless labeled hotfix,
and every other pull request merges as soon as its checks pass. In the figures,
#21 is a dependency update and the others come from your team.
Which schedules Mergify recognizes
Section titled Which schedules Mergify recognizesMergify treats a merge schedule as closed only when the queue rule’s conditions prove it:
-
A
scheduleorcurrent-datetimecondition listed inmerge_conditions, or nested in anand, closes the rule for every pull request outside its window. -
In an
orwithlabelorauthorconditions, as above, it closes the rule only for the pull requests that match none of them. A dependency update labeledhotfixhas its schedule open at any hour.
When a schedule sits in an or with any other condition, Mergify treats it as
open: the pull request is tested in its turn and, if its checks pass outside
the window, waits at its place like any other unmet merge condition.
Testing before the window opens
Section titled Testing before the window opensA pull request whose schedule is closed keeps its place in the queue, but is
tested behind the pull requests that can merge now, before its window opens.
Once its checks pass, its batch waits with the
batch status waiting_schedule and
merges when the window opens.
Giving up its place in the queue
Section titled Giving up its place in the queueA batch is tested on top of the batches ahead of it, so one waiting for its window would hold up everything behind it. Instead, it gives up its place to any batch behind it that could merge sooner, and is tested again behind it. A batch holding pull requests that can merge now and ones that cannot is split the same way, when that merges the first ones sooner.
Giving up its check slot
Section titled Giving up its check slotmax_parallel_checks caps how many
batches run their checks at once, and a
per-scope capacity
caps them within a scope. A batch tested ahead of its schedule only borrows a
slot no pull request needed: when one that can merge now is waiting for a slot,
the batch gives it back and is tested again once a slot is free. It does so
whatever
allow_checks_interruption
is set to: a schedule is not a priority.
What you see on the pull request
Section titled What you see on the pull requestGiving up its place or its check slot interrupts the checks of the waiting
pull request and of those batched with it or tested on top of it. They report
the
schedule-blocked-ahead-yielded
dequeue reason and stay in the queue, to be tested again on their own.
See also
Section titled See alsoWas this page helpful?
Thanks for your feedback!