Using Queues Rules

Learn how to implement queues rules and route your pull requests.


In larger projects with a high volume of pull requests, managing merges can become a complex task. This is where Mergify’s multiple queues feature can be a game-changer. It enables you to have finer control over the merge process by categorizing pull requests based on any criteria you define.

Queue rules allow you to organize your pull requests merge process into separate templates, each with its own merge configuration.

Mergify’s queue rules system is a powerful tool for managing a large number of pull requests. In essence, it allows you to create different merge processes, each with its unique configuration.

Multiple queue rules in Mergify can be configured using the queue_rules configuration in your YAML configuration file. Each queue rule should be identified by a unique name and can have different configurations. Here is a step-by-step guide on how to set up multiple queues and some configuration options that you can use.

  1. Define Your Queue Rules: Start by identifying the different queues you need. This could be based on your project’s requirements, the type of pull requests, or the teams working on them. Write your queue_conditions accordingly.
queue_rules:
  - name: urgent
    # This can be queued before CI finishes its first run if the PR has the urgent label
    queue_conditions:
      - label = urgent
    # We still want the CI to pass to merge the PR
    merge_conditions:
      - check-success = myci
  - name: standard
    # CI is needed for queueing and merging the PR
    queue_conditions:
      - check-success = myci

In this example, pull requests with the urgent label will be queued using the urgent queue rule before the first CI even finished, making sure the PR is updated and scheduled as soon as possible.

  1. Configure Each Queue Rule: For each queue rule, you can specify different configurations like batch_size.
queue_rules:
  - name: urgent
    ...
    batch_size: 2
  - name: standard
    ...
    batch_size: 5