Queue Freeze and Pause: No More Trade-Off Between Automation and Human Control
Imagine being in an industrial setting with a massive, high-precision machine diligently completing its tasks. Suddenly, the machine halts: there's a problem with a tiny, yet crucial, gear. The work comes to a standstill. The incident affects the whole assembly line, creating a significant delay in production.
This scenario parallels the life of software development teams dealing with complex code repositories. Like a well-oiled machine, their process depends heavily on the smooth and consistent integration of code changes. When a critical issue arises, it can halt the entire workflow, affecting productivity, timelines, and quality.
Having an effective automation solution like a merge queue with specific features helping you to stop everything before it gets worse can play a crucial role.
Using a Merge Queue: A Game Changer
The definition:
A merge queue prevents merging broken pull requests by serializing their merge and updating PRs with their base branch. Merging broken PRs can happen when outdated pull requests are being merged in their base branch.
Imagine the checkout line in a supermarket. The merge queue functions similarly. When developers want to integrate their changes into a shared repository, they submit a pull request. These requests are lined up in the queue and processed one by one, maintaining the integrity of the codebase and avoiding conflicting changes.
➡️ A merge queue creates a queue based on every PRs that pass the CI to merge them automatically and sequentially, and it updates any outdated PR with its base branch before it is merged. It forces the CI to retest the PR with the new code from its base branch. All in an automated way, catching any potential regression.
Haim from Epsagon, a Mergify user, wrote an article called ''How Merge Queues Made My Life Easier''.
He also created a GitHub repository with built-in PR automation and merge queue configuration.
Watch the Merge Queue Demo
🚀 Automation + Devs = Scaling
Using a merge queue automates the process of merging code changes, increasing efficiency and reducing human error. It helps manage the workload of developers by ensuring that code changes are systematically tested and integrated.
However, as with any automation, a merge queue can exacerbate issues when things go wrong. When an incident breaks the code, the automation might continue to merge faulty code, complicating the debugging process. This is where human intervention, helped by specific merge queue features, is necessary to apply brakes and fix the issues.
Taking Control with Queue Freeze & Queue Pause
Mergify understands the need to manage such incidents and has developed features that allow teams to handle code breakages better.
🥶 Queue Freeze
Mergify's Queue Freeze function allows you to freeze one or several merge queues simultaneously. This halts merging while other processes like checks and CI continue to work.
It's as if you're putting everything on standby, allowing you to isolate the problem without disrupting the development and testing processes.
Suppose an incident arises in your project, and you have three queues:
default
lowprio
hotfix
You can use the Queue Freeze feature to stop merging anything on your production branch (default
and lowprio
) while continuing to merge your fix PRs with your hotfix
queue.
Once the incident is resolved, you unfreeze everything, and the queues return to their previous state.
⏸️ Queue Pause
Queue Pause is another powerful feature that Mergify offers. It pauses every queue of a repository at the same time. All checks and CI jobs are paused, even those currently running.
This can be extremely useful when you are facing an incident involving your CI tool.
Let's say our CI is completely down, and every test job Mergify will trigger is going to fail. This is going to empty the queue in a matter of minutes. If you can detect this, you can actually pause the queue right away, fix your CI, and then resume the queue processing.
If you encounter an incident involving your CI tool, you can use the Queue Pause feature to block the merge of any pull request and prevent every CI job from running until you find a solution.
Again, after resolving the incident, you can resume the merge queue and return everything to its previous state.
A Merge Queue Yes, But a Good One 🥸
Having a merge queue is beneficial, but having a good merge queue is crucial.
With Mergify, not only do you get the standard features of a merge queue, but you also receive unique features that can help you handle code breakages effectively.
These features allow you to manage and scale your development process efficiently, ensuring that your merge queue saves you time instead of wasting it.
So next time you think about code integration and automation, think beyond a mere merge queue. Think Mergify.