Announcing Merge Queue Freezes

Announcing Merge Queue Freezes

Fabien Martinet

Our merge queues have evolved along with Mergify. We've introduced more features to support more use cases. Today we are glad to introduce a new feature to expand even more possibilities.

We designed a feature that allows engineering teams to freeze their merge queues to provide more control and security on how the code is merged.

Before going into the specifics of this new tool, if you are not familiar with what merge queues aims to resolve and improve, you might want to look at what a merge queue is.

Why even freezing? 🥶

The core of Mergify is to express conditions throughout several dimensions to your project and apply them to filter many pull requests. Working with merge queues can then be seen as managing various streams. Each stream flows with what you fill it with, following the designed configuration and conditions. But when working with flows and streams, one essential tool needs to be at your disposal to manage them securely and adequately: a valve system.

While merge queues solve many problems generated throughout the development life cycle of a software or application, they may also adapt to the various temporal and work dynamics a project can involve. Suppose you have security issues, tied or not, to your development, team vacations, or even the need to present your project at a conference. In that case, you might want to have total control over what can or cannot flows in your streams to accurately control your project’s state.

What freezing does 🧊

The freeze feature works like a valve and aims to answer those problems by giving teams the ability to choose which queues can merge and which ones cannot, according to their context. By freezing a queue, it is essential to note that every CI, check, and condition in it will still be run and verified for each pull request — only the merge part will not be executed. This implies a crucial point: teams can still work and provide code as usual while a queue is frozen. This makes sure that freezing does not break any work dynamics or momentum.

You can now adequately apply, update, delete, and even list freezes on your merge queues through a new API. To better grasp the core mechanics and advantages the freeze feature offers, we will explore it through a use case below.

Diving into the Use Case 🏊

For this use case, we’re going to assume that your project implements the following Mergify configuration file:

queue_rules:
  - name: high
    conditions: []
    speculative_checks: 3

  - name: default
    conditions: []
    speculative_checks: 3

pull_request_rules:
  - name: merge using the high queue
    conditions:
      - label=high
      - "#approved-reviews-by>=2"
      - check-success=compile-and-test
    actions:
      queue:
        name: high
        
  - name: merge using the default queue
    conditions:
      - label!=high
      - "#approved-reviews-by>=2"
      - check-success=compile-and-test
    actions:
      queue:
        name: default

You run a medium-size software development project. You have a well-formed developing team working on it and a more functional one covering project management and marketing.

This week, your marketing team is attending an IT convention, and some of them will make a presentation about your current application. The developer team needs to prevent any changes that may affect the project's ability to run safely. This is not the right time to add any new bugs.

For the next week and during the whole convention, as no pull requests should be integrated into the project, the team decides to freeze the default queue using the Mergify API, preventing any pull request from that queue from being merged.

During this time, the high queue will still process and merge any urgent code or fixes if the situation requires it, providing space for security and reliability. Moreover, every developing team will still be able to work as usual: as we stated earlier, the freeze does not influence the queue processing and testing.

Unfortunately, one of the developers finds a significant security issue that needs to be fixed urgently during the week. The project being in a frozen state, the problem can be handled and fixed smoothly using the high queue without interfering with the marketing team at the convention.

Once the event is over, the project can return to a functioning state: the team can unfreeze the queue. The repository is now back in its default original state and resumes processing and merging pull requests enqueued in the default queue.

By using the freeze feature and all the potential merge queues can now offer, everyone has been able to work without breaks in their dynamics while controlling and reducing the eventual risks linked to code merge.

At Mergify, we believe in the control you can have over your project’s life, and the new freeze feature is vouching for those beliefs.

Please share with us your best code freeze anecdotes! 😉