<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mergify on Medium]]></title>
        <description><![CDATA[Stories by Mergify on Medium]]></description>
        <link>https://medium.com/@mergifyio?source=rss-e6a9d0af0279------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*LMOivjEodHwDcYVE.jpg</url>
            <title>Stories by Mergify on Medium</title>
            <link>https://medium.com/@mergifyio?source=rss-e6a9d0af0279------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:28:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mergifyio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Case Study: CPython Development Workflow (v1 engine)]]></title>
            <link>https://medium.com/@mergifyio/case-study-cpython-development-workflow-472ae5843188?source=rss-e6a9d0af0279------2</link>
            <guid isPermaLink="false">https://medium.com/p/472ae5843188</guid>
            <category><![CDATA[mergify]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Mergify]]></dc:creator>
            <pubDate>Fri, 20 Jul 2018 13:58:56 GMT</pubDate>
            <atom:updated>2018-11-27T10:59:09.808Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s no secret that Mergify is written in <a href="https://python.org/">Python</a>. Our engine is <a href="https://github.com/mergifyio">open source</a> and is free for anyone to contribute to. That’s how we roll.</p><p>We’ve been doing Python for a long time, and that got us close to the development of Python itself and genuinely interested in their development processes.</p><p>A couple of years ago, the Python developers <a href="https://www.python.org/dev/peps/pep-0512/">decided to move to git and GitHub for developing the language</a>. What a smart move, right? 😉</p><p>What’s interesting for us is the automation workflow that Python built around GitHub. It’s pretty well setup and advanced compared to most projects. The CPython’s developers wrote and maintain bots to customize GitHub to their needs.</p><p>In this article, we decided to submit ourselves to an interesting exercise: we decrypted what CPython’s process for merging pull requests is, and how one could implement the same workflow using Mergify.</p><h3>Merging rules</h3><p>CPython merging rules are pretty simple. Let’s dissect the <a href="https://github.com/python/cpython/pull/8297">pull request #8297</a> to understand the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*yy5jiuW6AZC3Vcch0tiGAQ.png" /><figcaption>CPython pull request #8297</figcaption></figure><p>Once a pull request is created, there a few automatic checks that are being run such as continuous integration (tests), Contributors Licensed Agreement signed, etc. A human is then mandated to review the code and to approve it. Once it’s approved, it can be merged by a human — either the one that reviewed the patch, another one, or the author of the patch themselves if they want to have a final word. It is not visible in the above screenshot, but further digging indicates that some of the continuous integration jobs are mandatory: the merge button is greyed out if any of the jobs fail.</p><p>Overall, there is a couple of drawbacks in this process:</p><ol><li>It is possible to merge a pull request even if it has zero reviews. Basically, a developer could push the green button of merging without having to read the code. Using the “review” interface in GitHub makes sure you at least took a look at the files, preventing clicking the merge button in the wrong window—yes we’ve seen that.</li><li>If a committer wants to merge a patch, it has to wait for the continuous integration system to finish. It is possible that the patch is approved while some of the test jobs are not finished yet, needing the reviewer to come back at a later unknown moment to push the merge button.</li></ol><p>The good news is that it is possible to implement Python’s workflow—with a few improvements—using Mergify. It’ll fix those little drawbacks, while implementing the same process! How would you do that? Here’s an idea:</p><pre>rules:<br>  default:<br>    protection:<br>      required_status_checks:<br>        contexts:<br>          - continuous-integration/appveyor/pr<br>          - continuous-integration/travis-ci/pr<br>      required_pull_request_reviews:<br>        required_approving_review_count: 1<br>    enabling_label: ready-to-merge</pre><p>We’re not sure whether the Python folks would love to have the merge done with just a single human action—the review approval. There are teams that prefer to have a final merge action nonetheless. To that end, we’ve set enabling_label to the ready-to-mergelabel—once this label is set, Mergify automatically merges the pull request according to the rules. We set the rules to one reviewer and set the check jobs to be green.</p><p>With such a configuration, CPython would have the same workflow it has currently, plus it would solve all of the small issues listed above:</p><ol><li>Impossibility to merge a pull request if nobody clicked on the “Approve” button of the review system.</li><li>The merge automatically happens whenever the continuous integration finishes. There’s no need for a human to wait behind its screen to click a button.</li></ol><h4>No strict workflow</h4><p>CPython development workflow has another flaw that is not obviousthere are not the only ones. Many projects relying on pull requests chose to ignore the risk of merging code that seems to work while it’s going to break <em>master</em> because it’s not up-to-date. We wrote a few weeks ago <a href="https://medium.com/@mergifyio/you-are-merging-untested-code-1b9f1a10d533">an article on what we call the <em>strict workflow</em></a> that can solve this, and I beg you to read it to understand what might be wrong there.</p><h3>Backports</h3><p>CPython creates a stable branch each time it releases a new version of the language. There are branches for Python 2.7, Python 3.6, Python 3.7, etc.</p><p>Bugs happen, and when they get fixed in the <em>master</em> branch, they need to be ported back to stable branches. Usually that process is done manually by developers, but in this case, the CPython developers have been smart.</p><p>They created a bot, named <a href="https://github.com/python/miss-islington"><em>miss-islington</em></a>, that is in charge of doing the grunt work of backporting the patches to old branches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*XK1XJLxqhZT9VEnmZ-rVgQ.png" /><figcaption>CPython pull request #8251</figcaption></figure><p>It works that way:</p><ol><li>A human puts a label such as needs backport to 3.7 on a pull request.</li><li>Once the pull request is merged, <em>miss-islington</em> creates a copy of this pull request targeting the python:3.7 branch.</li><li>A human needs to approve the pull request.</li><li><em>miss-islington</em> merges the pull request if the continuous integration system validates it.</li></ol><p>We think it’s an excellent workflow. Why? Because it’s exactly the one we implemented inside Mergify. Who said we are biased?</p><p>If you want you own Miss Islington for doing backports and ease your life, just write something like this in your .mergify.yml :</p><pre>rules:<br>  default:<br>    automated_backport_labels:<br>      &quot;needs backport to 2.7&quot;: python:2.7<br>      &quot;needs backport to 3.6&quot;: python:3.6<br>      &quot;needs backport to 3.7&quot;: python:3.7</pre><p>This configuration file makes Mergify creates pull requests automatically when a pull request is merged with a label such as needs backport to 2.7. Fantastic!</p><p>We built Mergify to be able to adapt to most workflows. We hope that many more projects will be able to use it and automate their development workflows.</p><p>Feel free to suggest projects with different workflows in the comment section. We’d be delighted to feature them as case studies. 😀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=472ae5843188" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easing the burden of stable branches]]></title>
            <link>https://medium.com/@mergifyio/easing-the-burden-of-stable-branches-27bb1f2e15f2?source=rss-e6a9d0af0279------2</link>
            <guid isPermaLink="false">https://medium.com/p/27bb1f2e15f2</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[mergify]]></category>
            <category><![CDATA[maintenance]]></category>
            <dc:creator><![CDATA[Mergify]]></dc:creator>
            <pubDate>Tue, 10 Jul 2018 07:44:34 GMT</pubDate>
            <atom:updated>2018-07-10T08:58:03.285Z</atom:updated>
            <content:encoded><![CDATA[<p>Every piece of software out there is released one day or the other — unless you want to talk about <em>vaporware</em>. The processes and rules vary depending on the projects and how their maintainers see the life cycle of the software.</p><p>There is, however, a typical pattern that many, many software relies on: stable releases. Stable releases are versions of software that are released and maintained for a while.</p><p>The rules of maintenance of those versions depend on the engineers behind it. Linux, for example, has <a href="https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html">a long list of rules</a> for what can be merged into a stable release. Like most software, Linux implements a back-porting policy:</p><blockquote>To have the patch automatically included in the stable tree, add the tag Cc: stable@vger.kernel.org.</blockquote><p>Once your patch is merged into Linus’ tree, it will also be merged into the stable tree, making it easy to fix bugs both in the <em>master </em>branch and in the stable branch(es) of Linux. Naturally, Linux uses e-mails and mailing-lists as its primary development medium and not <a href="https://github.com/">GitHub</a>.</p><h4>What about GitHub?</h4><p>For people leveraging GitHub as their development platform, we identified a standard pattern for stable branches maintenance: maintainers usually creates stable branches where they cherry-pick patches, such as bug fixes, from their <em>master</em> branch.</p><p>This process is always manual. Different projects implement different processes, such as reading the commit log once a while for bug fixes to back-port. Some other projects implement a workflow based on labels, where a specific label is set on an issue or on a pull request to indicate it should be back-ported to certain stable branches.</p><h4>The Mergify workflow</h4><p>This last workflow seemed the most interesting to us, and that is the one we chose to automatize for our users. We implemented the workflow using labels. Here’s how it works.</p><p>When a pull request is created and is labeled with one of the configured labels, a new pull request will be automatically created once the original one is merged.</p><p>For example, if you create a rule to backport every pull request with the label <em>backport-to-stable-3.0</em> to the <em>stable-3.0</em> branch, you’d first create a pull request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/1*tJxdgCClcpagvrGtC7xHvA.png" /><figcaption>A pull request is created with a backport-to-stable-3.0</figcaption></figure><p>As soon as the this labeled pull request is merged, a new one is created, containing all the commits that the original one had. However, this new pull request targets the stable-3.0 branch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*ybH2_DtnN9BI1v5djtSCmg.png" /><figcaption>A copy of the original pull request is created for the stable branch</figcaption></figure><p>This new branch can be reviewed and merged using your usual criteria.</p><p>We believe that this workflow is a pretty common one and that automating it will save time for many projects out there! If you’re curious, you can check out the <a href="https://doc.mergify.io/automated-backport.html">full documentation</a>.</p><p>Otherwise, feel free to <a href="https://mergify.io/">try it</a>!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27bb1f2e15f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You are merging untested code]]></title>
            <link>https://medium.com/@mergifyio/you-are-merging-untested-code-1b9f1a10d533?source=rss-e6a9d0af0279------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b9f1a10d533</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[mergify]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Mergify]]></dc:creator>
            <pubDate>Mon, 02 Jul 2018 09:56:02 GMT</pubDate>
            <atom:updated>2018-07-03T13:59:37.357Z</atom:updated>
            <content:encoded><![CDATA[<p>The state-of-the-art practice on collaborative platforms like <a href="https://github.com/">GitHub</a>, is to run a suite of tests each time a developer sends a pull request. Each time a developer wants to merge something, their pull request has to pass the continuous integration system that validates everything, from unit testing to code style compliance.</p><p>When a pull request looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*O0aImMD0oFytbnW_0N7_Eg.png" /></figure><p>You know it’s ready to merge. That’s where <a href="https://mergify.io/">Mergify</a> can help you and merge the pull request for you, as <a href="https://medium.com/@mergifyio/stop-merging-your-pull-requests-manually-2affe2dd5510">we’ve seen last time</a>.</p><p>However, if you think that merging this pull request will not break your software because it’s all green, you’re wrong.</p><p>To understand why, imagine 2 pull requests, <em>A</em> and <em>B:</em></p><ul><li><em>A</em> adds a feature that paints a yellow emoji 😬 on the screen. The code is correct, the tests pass , and the developers approved it. This pull request is ready to merge.</li><li><em>B</em> adds a different feature, which makes sure that nothing yellow is ever printed on the screen. The software does not print anything yellow for now, so the tests pass, and the developers approved it. This pull request is ready to merge.</li></ul><p>For Git, <em>A</em> and <em>B</em> does not conflict: they modify different files, so they are mergeable together with the target branch. Here’s the <em>B</em> pull request continuous integration status:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*MVZjxThlxD2xro0t4QNsHQ.png" /><figcaption>The B pull request is mergeable</figcaption></figure><p>One of the developers clicks on the button to merge <em>A</em>. So this is the state of the continuous integration system for <em>B</em> now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*dgywv4mM2upeyMNOl91zDw.png" /><figcaption>The B pull request is marked as passing and is ready to be merged, even if <em>master evolved.</em></figcaption></figure><p>Another developer clicks on the button to merge <em>B</em>, and here is what you get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*9-Yj65eSIKdctJ6hK9LMsw.png" /></figure><p>Now, when running on the target branch, the test suite fails: the software is unhappy because there’s something yellow printed on the screen. And yet, everything was shiny green.</p><p>Bummer. 😬</p><blockquote>Some people will object that in this case, only <em>A</em> or <em>B</em> should have been merged and that the problem lies with the developer. While it might be true, it’s also very naive: transpose this example to large and complex software projects with tens of developers, and it’s more than likely that this kind of issue will happen.</blockquote><h4>Solving concurrent and incompatible merge</h4><p>There’s a simple way of solving this issue: disallowing any merge if the pull request is not strictly up to date with its target branch.</p><p>How does that work? Well, starting with the same conditions, one of the pull requests is going to be merged, let’s say <em>A</em>.</p><p>Now, <em>B</em> becomes un-mergeable. Why? Because it is not up to date with its target branch anymore. The target branch now contains <em>A</em>, and <em>B</em> has never been tested with <em>A</em>. Therefore, it needs to be updated with the new code that has been merged in the target branch. Once this is done, <em>B</em> will fail the continuous integration system, making developers aware of the issue before any broken code is merged into the mainline tree.</p><p>As you might guess, this workflow, which we name strict, is available when using <a href="https://mergify.io/">Mergify</a>. Once enabled, <a href="https://mergify.io/">Mergify</a> handles everything that’s described here, from picking a pull request to merge to updating the other pull requests with their target branch, to make sure they won’t break their target branch once merged. <a href="https://doc.mergify.io/strict-workflow.html">More details are available in our documentation.</a></p><p>Once you understand this problem, you’ll see the flaw in many continuous integration systems, unfortunately.</p><p>Except for the ones using <a href="https://mergify.io/">Mergify</a>. 😬</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b9f1a10d533" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop merging your pull requests manually]]></title>
            <link>https://medium.com/@mergifyio/stop-merging-your-pull-requests-manually-2affe2dd5510?source=rss-e6a9d0af0279------2</link>
            <guid isPermaLink="false">https://medium.com/p/2affe2dd5510</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Mergify]]></dc:creator>
            <pubDate>Fri, 29 Jun 2018 13:57:04 GMT</pubDate>
            <atom:updated>2018-06-29T13:57:26.785Z</atom:updated>
            <content:encoded><![CDATA[<p>If there’s something that we hate, it’s doing things manually when we know we could automate them. Are we alone in this situation? We doubt so.</p><p>Nevertheless, every day, they are thousands of developers using <a href="https://github.com/">GitHub</a> that are doing the same thing over and over again: they click on this button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/197/1*dOKWyBvVQdJBQlPQKhwiMA.png" /></figure><p>This does not make any sense.</p><p>Don’t get us wrong. It makes sense to merge pull requests. It just does not make sense that someone has to push this damn button every time.</p><p>It does not make any sense because every development team in the world has a known list of pre-requisite before they merge a pull request. Those requirements are almost always the same, and it’s something along those lines:</p><p>- Is the test suite passing?<br>- Is the documentation up to date?<br>- Does this follow our code style guideline?<br>- Have N developers reviewed this?</p><p>As this list gets longer, the merging process becomes more error-prone. “Oops, John just clicked on the merge button while there were not enough developer that reviewed the patch.” Rings a bell?</p><p>In our team, we’re like every team out there. We know what our criteria to merge some code into our repository are. That’s why we set up a continuous integration system that runs our test suite each time somebody creates a pull request. We also require the code to be reviewed by 2 members of the team before it’s approbated.</p><p>When those conditions are all set, we want the code to be merged.</p><p>Without clicking a single button.</p><p>That’s exactly how <a href="https://mergify.io/">Mergify</a> started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sMJbSt3sLrC-sIsPOVRBdw.png" /></figure><p><a href="https://mergify.io/">Mergify</a> is a service that pushes that merge button for you. You define rules in the <em>.mergify.yml</em> file of your repository, and when the rules are satisfied, Mergify merges the pull request.</p><p>No need to press any button.</p><p>Take a random pull request, like this one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*O0aImMD0oFytbnW_0N7_Eg.png" /></figure><p>This comes from a small project that does not have a lot of continuous integration services set up, just Travis. In this pull request, everything’s green: one of the owners reviewed the code, and the tests are passing. Therefore, the code should be already merged: but it’s there, hanging, chilling, waiting for someone to push that merge button. Someday.</p><p>With <a href="https://mergify.io/">Mergify</a> enabled, you’d just have to put this <em>.mergify.yml</em> a the root of the repository:</p><pre>rules:<br>  default:<br>    protection:<br>      required_status_checks:<br>        contexts:<br>          — continuous-integration/travis-ci<br>      required_pull_request_reviews:<br>        required_approving_review_count: 1</pre><p>With such a configuration, <a href="https://mergify.io/">Mergify</a> enables the desired restrictions, i.e., Travis passes, and at least one project member reviewed the code. As soon as those conditions are positive, the pull request is automatically merged.</p><p>We built <a href="https://mergify.io/">Mergify</a> as a <strong>free service for open-source projects</strong>. The <a href="https://github.com/mergifyio/mergify-engine">engine powering the service</a> is also open-source.</p><p>Now go <a href="https://mergify.io/">check it out</a> and stop letting those pull requests hang out one second more. Merge them!</p><p>If you have any question, feel free to ask us or write a comment below! And stay tuned — as <a href="https://mergify.io/">Mergify</a> offers a few other features that we can’t wait to talk about!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2affe2dd5510" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>