Announcing the New Mergify Engine

Announcing the New Mergify Engine

Julien Danjou

Today’s the big day for Mergify! We’re starting our brand new engine, built from fantastic engineering skills and the feedback provided by our users.

As we announced a few days ago, we’ve transformed Mergify into a complete workflow framework for GitHub. You can write a wild variety of rules to match pull requests and then execute different actions, from merging a pull request to backporting it to your favorite maintenance branch.

This new engine is available starting today for all of our existing and new users. And remember: it’s free for open source projects!

New Rule System

The engine is based on an entirely new rule system. The first version of Mergify was using the branch protection feature from GitHub and was per-branch based. This is not the case anymore and your protection settings won’t be modified by Mergify anymore.

The new rule system is can match a pull request based on any of its attribute (author, branch, title, etc) and execute any number of actions (merge, close, etc).

Better Reporting

Mergify now leverages the brand new Checks API from GitHub, that allows for better and finer reporting. You’ll see a full report of all of the rules that Mergify will apply to your pull request, making it easy to understand what’s happening and to debug your rules — if ever needed.

Auto Merge

The #1 feature, the one that our users cherish is the automatic merge functionality. To enable it, write a .mergify.yml file like that:

pull_request_rules:
  - name: automatic merge on approval and CI pass
    conditions:
     - "#approved-reviews-by>=1"
     - status-success=continuous-integration/travis-ci/pr
     - label!=work-in-progress
    actions:
      merge:
        method: merge

With such a rule, as soon as a pull request has at least one positive review, its Travis CI passing and is not labeled work-in-progress, it’ll be merged by Mergify. No need to click that green merge button manually!

You can write a large number of rules as you can match a pull request on many different attributes: author, branch name, labels, milestone, etc.

Let’s imagine you’re using Dependabot to get pull requests to update your software dependencies. You can automatically merge them with a rule like:

pull_request_rules:
  - name: automatic merge from Dependabot
    conditions:
      - author=dependabot[bot]
      - status-success=continuous-integration/travis-ci/pr
    actions:
      merge:
        method: merge

As soon as a pull request sent by the bot passes the Travis CI, it’ll be merged.

We provide a few more examples in our documentation, such as how to clean out branches once a pull request is merged.

More Actions

We’re providing this new engine with a few actions — not only merge. You can use close to close pull requests, backport to copy pull requests to another branch, dismiss_reviews to remove reviews, label to add or remove labels and delete_head_branch to delete the branch hosting the pull request.

We’re eager to see how you’re going to leverage Mergify to simplify your maintenance and ease your burden of managing pull requests.