<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Wakatepe-mergify</title>
    <description>The latest articles on Forem by Wakatepe-mergify (@wakatepemergify).</description>
    <link>https://forem.com/wakatepemergify</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1121881%2Fa4a19965-5e88-4496-b356-3f61afa44911.png</url>
      <title>Forem: Wakatepe-mergify</title>
      <link>https://forem.com/wakatepemergify</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wakatepemergify"/>
    <language>en</language>
    <item>
      <title>Managing Monorepos with a Merge Queue: a Game Changer</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 02 Nov 2023 15:28:42 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/managing-monorepos-with-a-merge-queue-a-game-changer-3k81</link>
      <guid>https://forem.com/wakatepemergify/managing-monorepos-with-a-merge-queue-a-game-changer-3k81</guid>
      <description>&lt;p&gt;Handling large codebases is a tough job, and it's even harder when dealing with monorepos. A monorepo is a single code repository that contains multiple projects or modules. It's a handy way to share code across teams and manage dependencies.&lt;/p&gt;

&lt;p&gt;But dealing with monorepos can be tricky. You have to make sure changes in one module don't mess up things in another. This is where a merge queue steps up. &lt;/p&gt;

&lt;h1&gt;
  
  
  Monorepos: Why Are They Challenging?
&lt;/h1&gt;

&lt;p&gt;Monorepos have several benefits, such as easier dependency management, better code sharing, and simpler code refactoring. However, managing a monorepo can be challenging, especially as the codebase grows. Some of the main challenges of managing monorepos include the following:&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ Difficulties with Dependency Management
&lt;/h2&gt;

&lt;p&gt;With so much code in one repository, it can be challenging to ensure that dependencies are correctly managed across all projects and services.&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ Slow Build and Test Times
&lt;/h2&gt;

&lt;p&gt;Building and testing the entire monorepo can take a lot of time, especially as it grows.&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ Managing Conflicts and Overlapping Changes
&lt;/h2&gt;

&lt;p&gt;With many developers working on the same codebase, it can be challenging to manage conflicts and ensure that changes made in one module do not conflict with changes made in another.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bxe3emh9ldkd09ra14x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bxe3emh9ldkd09ra14x.png" alt="The difference between Multi Repo and Mono Repo. Source: Voiceflow"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Managing Monorepos with a Merge Queue
&lt;/h1&gt;

&lt;p&gt;To help overcome these challenges, betting on a merge queue sounds like a great idea.  &lt;/p&gt;

&lt;p&gt;Here are some of the benefits of using a merge queue for managing monorepos:&lt;/p&gt;

&lt;h2&gt;
  
  
  1️⃣ Reduced Risk of Conflicts and Overlapping Changes
&lt;/h2&gt;

&lt;p&gt;A merge queue ensures that changes made in one module do not conflict with changes made in another by managing the merge order and dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  2️⃣ Increased Efficiency with Automatic Dependency Management
&lt;/h2&gt;

&lt;p&gt;A merge queue automatically manages dependencies, making it easier for developers to work on their individual projects and modules.&lt;/p&gt;

&lt;h2&gt;
  
  
  3️⃣ Faster build and test times
&lt;/h2&gt;

&lt;p&gt;By managing the merge order, a merge queue reduces build and test times by ensuring that changes that depend on each other are merged together.&lt;/p&gt;

&lt;p&gt;Using a merge queue for managing monorepos is a real game changer. Developers can set up a merge queue for their monorepo and customize it to fit their specific needs. For example, they can set up different merge queues for different projects or modules and specify the order in which changes should be merged.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mergify for Monorepo: How Does it Work?
&lt;/h1&gt;

&lt;p&gt;When you submit a pull request to a monorepo, it can be put in one or multiple queues at the same time. With its feature, Partition Rules, Mergify will not merge the pull request until it has been validated by each queue in which it is. This collaboration ensures that the pull request meets all the requirements of each queue.&lt;/p&gt;

&lt;p&gt;If the pull request is in multiple queues and fails to meet the requirements of at least one queue, it cannot be merged. To merge, the pull request must meet all the criteria of each queue it is in.&lt;/p&gt;

&lt;p&gt;You can also use queue rules to handle different projects in the monorepo that have different criteria for merging pull requests. To do this, you can replicate the queue rules logic for each project and use the  attribute &lt;code&gt;queue-partition-name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A partition rule has the following parameters:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3dv2kf9uao74rouk11u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3dv2kf9uao74rouk11u.png" alt="Mergify's Parameters"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Handle Different Projects in a Monorepo Using Partition Rules
&lt;/h2&gt;

&lt;p&gt;If a pull request contains a modification on any file in the folder &lt;code&gt;projectA/&lt;/code&gt; it will be added in the partition projectA, if it contains a modification on any file in the folder &lt;code&gt;projectB/&lt;/code&gt; then it will be added in the partition projectB, if it contains a modification in both folder &lt;code&gt;projectA/&lt;/code&gt; and &lt;code&gt;projectB/&lt;/code&gt;, then it will be added to both partitions.&lt;/p&gt;

&lt;p&gt;If none of the two partitions' rules matches, then the PR will be added in both partitions. The &lt;code&gt;queue_rules&lt;/code&gt; will still determine in which queue in the partition(s) the pull request will be added in.&lt;/p&gt;

&lt;p&gt;Here is a table representing the partition and queues with the code below:&lt;/p&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
    
    &lt;thead&gt;
    &lt;tr&gt;
        &lt;th&gt;Project A&lt;/th&gt;
        &lt;th&gt;Project B&lt;/th&gt;
    &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;tr&gt;
        &lt;td&gt;Hotfix&lt;/td&gt;
        &lt;td&gt;Hotfix&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;default&lt;/td&gt;
        &lt;td&gt;default&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;shared:
    priority_rules: &amp;amp;priority_rules
        - name: hotfix PR detected
          conditions:
            - label=hotfix
          priority: high
        - name: lowprio PR detected
          conditions:
            - author=dependabot[bot]
          priority: low

pull_request_rules:
   - name: queue PR with queue label
     conditions:
       - label=queue
     actions:
       queue:

partition_rules:
  - name: projectA
    conditions:
      - files~=^projectA/

  - name: projectB
    conditions:
      - files~=^projectB/

queue_rules:
  - name: hotfix
    priority_rules: *priority_rules
    routing_conditions:
      - label=hotfix
    merge_conditions:
      - or:
        - and:
          - queue-partition-name=projectA
          - check-success=ciA
        - and:
          - queue-partition-name=projectB
          - check-success=ciB

  - name: default
    priority_rules: *priority_rules
    merge_conditions:
      - or:
        - and:
          - queue-partition-name=projectA
          - check-success=ciA
        - and:
          - queue-partition-name=projectB
          - check-success=ciB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Managing monorepos can be challenging, but with a merge queue, and especially Mergify's one, developers can work more efficiently and with more confidence. &lt;/p&gt;

&lt;p&gt;A merge queue allows developers to manage their monorepo as a single codebase while still being able to work on individual projects and modules. This improves collaboration and communication between teams, reduces the risk of conflicts and errors, and speeds up the development process. If you're struggling with managing a monorepo, consider giving &lt;a href="https://mergify.com/merge-queue" rel="noopener noreferrer"&gt;Mergify's new feature a try&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>monorepo</category>
      <category>cicd</category>
      <category>mergequeue</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>How to Get Rid of Flaky Tests? Best Practices</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 26 Oct 2023 14:16:39 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/how-to-get-rid-of-flaky-tests-best-practices-4if6</link>
      <guid>https://forem.com/wakatepemergify/how-to-get-rid-of-flaky-tests-best-practices-4if6</guid>
      <description>&lt;p&gt;Flaky tests are a thorn in the side of most software development teams.&lt;br&gt;
Even more so when they have set up an automated CI/CD workflow.&lt;/p&gt;

&lt;p&gt;In addition to the security holes they create, flaky tests also lead to the need for manual intervention.&lt;/p&gt;

&lt;p&gt;Getting rid of them and cleaning up your test suite should therefore be a priority. Luckily, this article focuses on the different ways of eradicating flakiness in your tests.&lt;/p&gt;

&lt;h1&gt;
  
  
  Understanding Flaky Tests
&lt;/h1&gt;

&lt;p&gt;Flaky tests are like the chameleons of the testing world, as they change their behavior depending on the context. A test that intermittently fails and passes poses a challenge for developers, who often spend countless hours chasing down false negatives.&lt;/p&gt;

&lt;p&gt;These tests lack reliability and consistency, making it difficult to determine the true quality of the software being tested. The variability in test results can stem from a variety of sources, including environmental factors, race conditions, non-deterministic code, or external dependencies.&lt;/p&gt;

&lt;p&gt;If you want to know more, take a look at Fabien's article explaining what is a flaky test and how to classify them.&lt;/p&gt;

&lt;h1&gt;
  
  
  Flaky Tests Remediation: Best Practices
&lt;/h1&gt;

&lt;p&gt;Addressing flaky tests requires a proactive approach and continuous effort.&lt;/p&gt;

&lt;p&gt;This subject has already been covered by Fabien in his article &lt;a href="https://blog.mergify.com/flaky-tests-how-to-fix-them/"&gt;Flaky Tests: How to Fix Them?&lt;/a&gt; If you haven't read it, you should.&lt;/p&gt;

&lt;p&gt;In it, he shares with you the best practices to adopt to get rid of your flaky tests:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Split your test suites.&lt;/li&gt;
&lt;li&gt;Execute tests on VMs or controlled environments.&lt;/li&gt;
&lt;li&gt;Log and document.&lt;/li&gt;
&lt;li&gt;Separate and quarantine.&lt;/li&gt;
&lt;li&gt;Retry your tests (the good way).&lt;/li&gt;
&lt;li&gt;Monitor and alert.&lt;/li&gt;
&lt;li&gt;Develop processes of investigations.&lt;/li&gt;
&lt;li&gt;Run tests multiple times before merge.&lt;/li&gt;
&lt;li&gt;Write and apply good practices.&lt;/li&gt;
&lt;li&gt;Without getting too repetitive, here are other best practices you should also keep in mind.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🐞 Debugging and Root Cause Analysis
&lt;/h2&gt;

&lt;p&gt;Invest time in understanding and diagnosing the causes behind flaky tests. Analyze test logs, gather relevant data, and identify patterns or dependencies that may contribute to their instability.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌍 Test Environment Stability
&lt;/h2&gt;

&lt;p&gt;Ensure that the test environment is consistent and stable. Eliminate external factors that can introduce variability and cause intermittent failures, such as network issues, timing dependencies, or resource constraints.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Test Isolation and Determinism
&lt;/h2&gt;

&lt;p&gt;Design tests to be independent and deterministic, ensuring they don't rely on external resources or produce different outcomes with the same inputs. Utilize techniques like mocking or stubbing to create controlled and predictable testing environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚙️ Test Retry Mechanisms
&lt;/h2&gt;

&lt;p&gt;Implement retry mechanisms for flaky tests to reduce false positives. By re-running tests that fail intermittently, you can increase the likelihood of obtaining consistent and reliable results.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 Test Monitoring and Reporting
&lt;/h2&gt;

&lt;p&gt;Establish a robust test monitoring and reporting system to identify flaky tests in real time. Regularly review test results, track their stability over time, and prioritize their resolution as part of ongoing test maintenance efforts.&lt;/p&gt;

&lt;p&gt;You can also take advantage of various tools, such as those from CircleCI, Jetbrains, or &lt;a href="https://mergify.com/ci-monitoring"&gt;CI Monitoring&lt;/a&gt; solution from Mergify.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Flaky tests are a real pain in the @$? and they pose a significant challenge in the realm of CI/CD.&lt;/p&gt;

&lt;p&gt;Their inconsistent behavior undermines the reliability and efficiency of software engineering teams.&lt;/p&gt;

&lt;p&gt;However, by adopting the good practices we've just presented in this article and &lt;a href="https://blog.mergify.com/flaky-tests-how-to-fix-them/"&gt;"Flaky Tests: How to Fix Them?"&lt;/a&gt;, you'll limit the nuisance.&lt;/p&gt;

&lt;p&gt;Putting them into practice quickly and regularly will save you a lot of trouble. Problems that are trivial today, but could become major threats tomorrow.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>cicd</category>
      <category>automation</category>
      <category>devops</category>
    </item>
    <item>
      <title>Why Should You Get Rid Of Flaky Tests? Unmasking the Hidden Nuisance in your CI/CD Pipeline</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 26 Oct 2023 13:58:42 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/why-should-you-get-rid-of-flaky-tests-unmasking-the-hidden-nuisance-in-your-cicd-pipeline-2lle</link>
      <guid>https://forem.com/wakatepemergify/why-should-you-get-rid-of-flaky-tests-unmasking-the-hidden-nuisance-in-your-cicd-pipeline-2lle</guid>
      <description>&lt;p&gt;Amidst the quest for automation and speed, a common obstacle emerges: flaky tests. These seemingly innocent but troublesome tests can undermine the entire CI/CD optimization process.&lt;/p&gt;

&lt;p&gt;To understand the nuisance of flaky test, it's like having a roommate you can more or less count on.&lt;/p&gt;

&lt;p&gt;When you ask him for a hand, you never know how he'll handle your request.&lt;/p&gt;

&lt;p&gt;He may or may not pay the rent, and the same goes for chores. When you get home from work, your last yoghurt may be waiting for you, or it may be digesting in his belly.&lt;/p&gt;

&lt;p&gt;That's what we call an unreliable roommate. Despite identical rules, conditions and environment, he can make random decisions.&lt;/p&gt;

&lt;p&gt;In fact, a flaky test is just the same. Under identical conditions, a flaky test will either pass or fail. A sort of Russian roulette.&lt;/p&gt;

&lt;p&gt;In this article, we will dive into the concept of flaky tests, understand their implications, and explore why they are a nuisance.&lt;/p&gt;

&lt;h1&gt;
  
  
  What Are Flaky Tests?
&lt;/h1&gt;

&lt;p&gt;Flaky tests, also known as unreliable or intermittent tests, are automated tests that exhibit inconsistent behavior.&lt;/p&gt;

&lt;p&gt;These tests are characterized by their ability to produce both passing and failing results for the same codebase without any modifications. In simpler terms, running a flaky test multiple times can yield different outcomes, leading to inconsistent feedback regarding the stability and correctness of the system.&lt;/p&gt;

&lt;p&gt;If you want to know more about what are flaky tests and their classification, you should &lt;a href="https://blog.mergify.com/flaky-tests-who-are-they-and-how-to-classify-them/"&gt;read Fabien's article about flaky tests definition and classification&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Nuisance of Flaky Tests
&lt;/h1&gt;

&lt;p&gt;Flaky tests can be detrimental to CI/CD optimization in several ways:&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ False Positives
&lt;/h2&gt;

&lt;p&gt;Flaky tests can generate false positives, reporting failures when no actual defects exist. This can create unnecessary delays and frustration for developers, who have to investigate and fix non-existent issues, leading to wasted time and effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  ❌ False Negatives
&lt;/h2&gt;

&lt;p&gt;Conversely, flaky tests can also produce false negatives, where actual defects go undetected. When tests sporadically pass, potential issues can slip through the cracks, jeopardizing the quality of the software being delivered.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤨 Unreliable Feedback
&lt;/h2&gt;

&lt;p&gt;The primary purpose of automated tests is to provide reliable feedback on the stability and quality of the codebase. Flaky tests undermine this objective, making it difficult to distinguish between genuine failures and transient issues, eroding developers' trust in the test suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  📉 Decreased Productivity
&lt;/h2&gt;

&lt;p&gt;Flaky tests hinder the efficiency of the development process. Developers spend precious time investigating and re-running tests to identify and reproduce failures, detracting them from focusing on crucial tasks like implementing new features or fixing genuine bugs.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤔 Impaired Confidence
&lt;/h2&gt;

&lt;p&gt;Flaky tests erode the confidence of both developers and stakeholders. Developers become skeptical of the test results, and stakeholders may lose faith in the reliability of the software being produced. This lack of confidence can have far-reaching consequences, affecting team morale and the overall success of the project.&lt;/p&gt;

&lt;h1&gt;
  
  
  How Can I Get Rid of Them?
&lt;/h1&gt;

&lt;p&gt;Flaky tests are a real nuisance, and their impact is often underestimated. This problem, if not properly dealt with, will be dragged along like a ball and chain by the developers on your team. And the consequences can be dire:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Velocity at half-mast,&lt;/li&gt;
&lt;li&gt;Vulnerable code base,&lt;/li&gt;
&lt;li&gt;Loss of trust and consideration among developers...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Suffice it to say, it doesn't look good! Faced with this situation, it's time to adopt a proactive stance and look for concrete solutions. Fabien has already dealt with this subject in his article Flaky Tests: How to Fix Them?&lt;/p&gt;

&lt;p&gt;You can also take advantage of various tools, such as those from CircleCI, Jetbrains, or &lt;a href="https://mergify.com/ci-monitoring"&gt;CI Monitoring&lt;/a&gt; solution from Mergify.&lt;/p&gt;

</description>
      <category>testing</category>
      <category>devops</category>
      <category>programming</category>
      <category>cicd</category>
    </item>
    <item>
      <title>The Developer Experience, from your Own Team to your End-Users</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 21 Sep 2023 15:34:09 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/the-developer-experience-from-your-own-team-to-your-end-users-5d7i</link>
      <guid>https://forem.com/wakatepemergify/the-developer-experience-from-your-own-team-to-your-end-users-5d7i</guid>
      <description>&lt;p&gt;Developer experience, or DX, refers to all a developer's perceptions, feelings, and experiences in interacting with a tech product or software. In this instance, 'interaction' can be two-fold.&lt;/p&gt;

&lt;p&gt;A developer could use your product, such as a software development kit or an API, to create a product for the end user. Two, the developer could be creating a product for you, such as an app, working as your employee.&lt;/p&gt;

&lt;p&gt;Since the term 'user experience' is more commonly known than DX, it helps to compare the two. Do they both tie in? A DX vs UX comparison will show that user experience concerns the end users, while developer experience concerns the developers who create the product for end users.&lt;/p&gt;

&lt;p&gt;Both have one main thing in common; the aim to create a good product. That makes DX important for both the external users and the internal teams. For the former, developer satisfaction means better products, increased user satisfaction, and higher user retention. For the latter, it results in faster development and higher productivity.&lt;/p&gt;

&lt;p&gt;So how do you go beyond the DX vs UX differences and balance both in your organization? Let's find out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer Experience for Your Team
&lt;/h2&gt;

&lt;p&gt;Internal developer experience comprises the tools, processes, and culture you create for your development team. Simply put, it's the experience developers have while working on an internal project.&lt;/p&gt;

&lt;p&gt;For instance, a team of developers may be creating a new app for your product. Many factors, such as the workflows, level of support, tools, technology, mentorship, collaboration, etc., will impact their experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of Prioritizing Internal DX
&lt;/h3&gt;

&lt;p&gt;When you prioritize internal DX, you improve employee retention and increase the number of success stories from your organization. Here are some other benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increased Productivity: When developers can access effective training, streamlined workflows, and modern tools, they work better. Higher productivity results in faster project delivery and better efficiency.&lt;/li&gt;
&lt;li&gt;Better Innovation: With proper support, responsiveness, and mentorship, there's a greater chance of creativity and innovation. An organization that focuses on internal DX can create an environment that fosters risk-taking and experimentation.&lt;/li&gt;
&lt;li&gt;High-Quality Code: The prioritization of internal DX also results in better code quality. Developers can leverage feedback mechanisms to write scalable, maintainable, and high-quality code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tips to Improve Internal DX
&lt;/h3&gt;

&lt;p&gt;McKinsey recommends focusing on the following to improve developer velocity: ''tools, culture, product management, and talent management''. Organizations can heed this advice by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Offering growth and learning opportunities to developers to help them stay up-to-date with new technologies&lt;/li&gt;
&lt;li&gt;Providing user-friendly and modern technologies for the development process&lt;/li&gt;
&lt;li&gt;Creating streamlined workflows, such as code testing, review, and deployment, to lower friction&lt;/li&gt;
&lt;li&gt;Creating a collaborative culture where developers can work with their colleagues for better outputs&lt;/li&gt;
&lt;li&gt;Listening to developer feedback and using it to make improvements in the development environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--09gBGmbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4r1bv4j7o2xgjbnpcng7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--09gBGmbH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4r1bv4j7o2xgjbnpcng7.png" alt="Figure showing the correlation between Developer Velocity and Market Performance" width="800" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Developer Experience for Your End-Users
&lt;/h2&gt;

&lt;p&gt;External DX is the experience developers have when they use a company's products or services to build their software. It comprises the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API usability and ease of integration&lt;/li&gt;
&lt;li&gt;Quality of support and documentation&lt;/li&gt;
&lt;li&gt;Tools, libraries, and frameworks available for development&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A comparison of StackOverflow Developer Surveys over the years shows that the time developers spend per project has been decreasing. That's only possible with a decent external DX.&lt;/p&gt;

&lt;h3&gt;
  
  
  Importance of End-Users DX
&lt;/h3&gt;

&lt;p&gt;It's imperative to provide a good external DX for users since it results in increased use and adoption of a company's software development products. A higher adoption helps drive revenue generation and business growth.&lt;/p&gt;

&lt;p&gt;It also helps users by allowing them to create robust applications and enjoy better integrations. Developers who use these products can also create more diverse applications in shorter timeframes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Best Practices for Improving External DX
&lt;/h3&gt;

&lt;p&gt;A reference book on the subject: the Devrel Book. It presents a mapping of the developer's journey and the external developer experience. This book gives you the contact points you need to optimize.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r0VUDHqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5m82aqxrb2wq0hc91qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r0VUDHqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5m82aqxrb2wq0hc91qf.png" alt="Developer Journey and Developer Experience by DevRelBook&amp;lt;br&amp;gt;
" width="800" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some good practices for improving external DX include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Publishing clear and understandable landing pages and product pages,&lt;/li&gt;
&lt;li&gt;Creating FAQ page,&lt;/li&gt;
&lt;li&gt;Providing clear documentation,&lt;/li&gt;
&lt;li&gt;Helping developers to get their first win with Quick Start Guides that include explanations of endpoints, examples, and code snippets,&lt;/li&gt;
&lt;li&gt;Offering libraries and sample codes to give developers a starting point for the development,&lt;/li&gt;
&lt;li&gt;Making it easy to sign up or register,&lt;/li&gt;
&lt;li&gt;Offering a sandbox to "play" with the tool, without any risk,&lt;/li&gt;
&lt;li&gt;Communicating about news, features and changes through a changelog,&lt;/li&gt;
&lt;li&gt;Introducing all the integrations and extensions. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Balancing Internal and External DX
&lt;/h2&gt;

&lt;p&gt;If a company has poor internal DX, it can lead to errors and delays in API improvement. That would further reduce experience quality for external developers using the company's product.&lt;/p&gt;

&lt;p&gt;Likewise, external DX can also impact internal DX. Suppose external developers run into various issues with the SDK (software development kit) or API.&lt;/p&gt;

&lt;p&gt;They would need increased support from the company's internal developers. It could divert resources away from a company's internal development processes.&lt;/p&gt;

&lt;p&gt;A balance between the two is necessary to keep developers satisfied on both ends. Google is a good example of such a company. On one end, Google offers SDKs and APIs for Google Cloud Platform, Google Maps, and Google Drive. These products allow developers to integrate Google's tech into their products.&lt;/p&gt;

&lt;p&gt;Internally, Google builds software like Google Chrome and Google Ads. Google's internal developers often use the same tech and tools the company offers to external developers.&lt;/p&gt;

&lt;p&gt;In doing so, Google strikes a balance as the collective use of resources requires consistency and reliability to keep both internal and external projects running smoothly.&lt;/p&gt;

&lt;p&gt;Other organizations can follow suit by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gathering insights and feedback from internal and external developers to learn about improvement points&lt;/li&gt;
&lt;li&gt;Aligning internal and external goals to create synergy between the two&lt;/li&gt;
&lt;li&gt;Ensuring consistency across products when creating APIs, SDKs, and libraries&lt;/li&gt;
&lt;li&gt;Encouraging user advocacy for internal and external projects.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Improve DX With Automation
&lt;/h2&gt;

&lt;p&gt;Developer experience is an important component of measuring success today. While improving the developer experience can take time, one step can make some quick improvements. That is automation.&lt;/p&gt;

&lt;p&gt;With a tool like Mergify, workflow automation becomes a breeze. Mergify optimizes the CI/CD pipeline by queuing, updating, and merging your pull requests automatically. It saves time and money by eliminating outdated PRs and manual rebase, allowing faster project delivery and better code security.&lt;/p&gt;

&lt;p&gt;Most importantly, Mergify can improve the developer experience by providing reliable workflows with minimal friction. &lt;/p&gt;

</description>
      <category>developer</category>
      <category>productivity</category>
      <category>devops</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Testing your Pull Requests Smartly with a Merge Queue</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 21 Sep 2023 15:20:20 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/testing-your-pull-requests-smartly-with-a-merge-queue-14l6</link>
      <guid>https://forem.com/wakatepemergify/testing-your-pull-requests-smartly-with-a-merge-queue-14l6</guid>
      <description>&lt;p&gt;Before we start, let's agree: all your pull requests must be tested. If you don't agree with this first point, reading this article may seem like a waste of your time.&lt;/p&gt;

&lt;p&gt;Unless you're ready to change your mind?&lt;/p&gt;

&lt;p&gt;While it's important to test all the changes you wish to integrate into your code base, it's important to test them intelligently, and at the right time.&lt;/p&gt;

&lt;p&gt;Good news: you can do this with a merge queue!&lt;/p&gt;

&lt;h2&gt;
  
  
  Intelligent PR testing: CI savings and exacerbated velocity
&lt;/h2&gt;

&lt;p&gt;To test your pull requests as efficiently as possible, you should do it in two stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;tests to validate your PR and get it into the queue,&lt;/li&gt;
&lt;li&gt;tests to merge your pull request into main.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Split your Test Suite
&lt;/h3&gt;

&lt;p&gt;First, divide your test suite into two distinct categories, differentiating between unit tests and more global tests such as functional or end-to-end tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Queue Entry Conditions and Unit Tests
&lt;/h3&gt;

&lt;p&gt;For a pull request to be included in the merge queue, it must be valid and of good quality. After all, why attempt to merge poor-quality changes?&lt;/p&gt;

&lt;p&gt;With this in mind, you can define entry conditions. In general, we recommend choosing the requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More than 1 approval,&lt;/li&gt;
&lt;li&gt;Unit Test CI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If these checks pass, then your PR is validated and can enter the queue. Here's what your YAML file might look like.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;queue_rules:
  - name: default
    queue_conditions:
      - check-success = mycijob
      - "#approved-reviews-by &amp;gt;= 1"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the pull request enters the queue called default if the CI named mycijob has passed. Moreover,  to enter the queue, the PR needs to be approved by at least one contributor.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pull Requests Rules and Conditions to Merge
&lt;/h3&gt;

&lt;p&gt;Your PR is now in the merge queue. It will make its way to the top of the queue. This moment corresponds to the merge momentum. The PR has just been updated; it's ready to be tested and merged.&lt;/p&gt;

&lt;p&gt;So, it's at this precise moment that you should launch all your integration tests. Not before (and certainly not after!)&lt;/p&gt;

&lt;p&gt;You can define new merge conditions for your pull request, in other words, new checks, corresponding to the CI job of your functional and end-to-end tests.&lt;/p&gt;

&lt;p&gt;Here's how it might look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;queue_rules:
  - name: default
    queue_conditions:
      - check-success = mycijob
      - "#approved-reviews-by &amp;gt;= 1"
    merge_rules:
      - check-success = mycijob-extra
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The merge_rules define the condition required to merge a pull request once it is in the merge queue. Here, the PR will be merged if the CI called "mycijob-extra" has passed successfully.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Mergify injects all branch protection settings defined by GitHub, so there's no need to repeat them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why Should You Test Your PR this Way?
&lt;/h2&gt;

&lt;p&gt;Following this strategy, each pull request is fully tested, but above all intelligently, by launching the right type of test at the right time to match your standards and workflows.&lt;/p&gt;

&lt;p&gt;But the coolest thing about all this is the benefits you'll reap. Using this testing strategy for your pull requests ensures that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Limit your CI costs, since you only run your tests once, and when you need to,&lt;/li&gt;
&lt;li&gt;Speed up your project and improve your velocity. Launch large tests only when the PR is ready to be merged, and avoid relaunching your tests because of out-of-date PRs,&lt;/li&gt;
&lt;li&gt;Secure your code base: only up-to-date and thoroughly tested PRs can be integrated.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, are you convinced? If not, we invite you to try Mergify and its merge queue. &lt;/p&gt;

</description>
      <category>pullrequest</category>
      <category>productivity</category>
      <category>mergequeue</category>
      <category>devops</category>
    </item>
    <item>
      <title>Updating, Testing, and Merging Several Pull Requests at Once with a Merge Queue</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Mon, 21 Aug 2023 14:52:11 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/updating-testing-and-merging-several-pull-requests-at-once-with-a-merge-queue-2go7</link>
      <guid>https://forem.com/wakatepemergify/updating-testing-and-merging-several-pull-requests-at-once-with-a-merge-queue-2go7</guid>
      <description>&lt;p&gt;The rapid expansion of a project can lead to an exponential increase in the number of pull requests requiring processing. This surge in pull requests brings an inevitable, heightened demand for Continuous Integration (CI), leading to a consequent surge in both the time needed for CI and, subsequently, the associated costs. So how can this be mitigated?&lt;/p&gt;

&lt;p&gt;Implementing a merge queue offers a feasible solution, as it can effectively manage and reduce the number of CI jobs initiated per pull request. This is a natural and direct advantage of a merge queue. But to enhance efficiency even further, you might consider formulating a smart testing strategy and utilizing a distinct feature known as batches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Avoid Rerunning Tests
&lt;/h2&gt;

&lt;p&gt;In the context of a large-scale project, a growing number of pull requests can have an exponential effect on your CI times. This is especially true if you refuse to merge out-of-date pull requests — and you should.&lt;/p&gt;

&lt;p&gt;Let's take the example of a project with 20 open pull requests.&lt;/p&gt;

&lt;p&gt;Without a merge queue, after the first pull request has been merged, the other 19 would have to be rebased as they're out-of-date, and 19 CI jobs would have to be restarted.&lt;/p&gt;

&lt;p&gt;After the second merged PR, 18 PRs would have to be rebased, and 18 CI jobs would restart. And so on.&lt;/p&gt;

&lt;p&gt;With a merge queue, if you have 20 open pull requests, you'll only have to rebase 20 and schedule 20 CI jobs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7RUccYPU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62mbm335q4i58f4ynjnn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7RUccYPU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/62mbm335q4i58f4ynjnn.png" alt="Merge Queue Scheme" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A merge queue solves this issue by processing your pull requests sequentially and automatically, one by one. After automatically rebasing it, a merge queue triggers a CI job to run on that pull request. The same principle applies to the second pull request and then to all the others.&lt;/p&gt;

&lt;p&gt;To sum up, without a merge queue, the number of CI jobs could be equal to:&lt;br&gt;
20+19+18+17+...+1=210 CI jobs! As opposed to just 20 jobs in all with a merge queue.&lt;/p&gt;
&lt;h2&gt;
  
  
  Smart Test Strategy: Reduce CI Time, Increase Velocity
&lt;/h2&gt;

&lt;p&gt;By using a merge queue, you can go even further to optimize your CI times and improve the velocity of your project.&lt;/p&gt;

&lt;p&gt;Let's say some of your tests are very long and therefore require a lot of CI time.&lt;/p&gt;

&lt;p&gt;If you launch them as soon as you create your PR, you need to be sure to merge them right away if they pass.&lt;/p&gt;

&lt;p&gt;However, without automation, you are likely to have to rebase this PR and therefore have to run your tests several times. Each iteration represents time and money.&lt;/p&gt;

&lt;p&gt;With a merge queue, it is possible to split your tests to optimize your workflow.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mzuNOuvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/is8lqsbyu3qpmsrqxwpw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mzuNOuvs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/is8lqsbyu3qpmsrqxwpw.png" alt="Test your PRs Smartly with a Merge Queue" width="800" height="332"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When a pull request is created, it only runs the unit tests. If they pass, the pull request will be included in the merge queue. Once it's at the top of the queue, it's time to go: just after being rebased, this is the best time to launch your longest and most expensive tests (functional tests, end-to-end tests...).&lt;/p&gt;

&lt;p&gt;If those tests pass, the pull request will be merged, and you only had to run your tests once, at the right time.&lt;/p&gt;
&lt;h2&gt;
  
  
  Going Further: Introducing Batches Feature
&lt;/h2&gt;

&lt;p&gt;Now that you know a little more about the merge queue and how it can help you reduce your CI time, it's time to look at a real game changer.&lt;/p&gt;

&lt;p&gt;We're talking about Mergify's Merge Queue's exclusive feature: batches.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zBKl8lr6B2w"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;With batches, you can check the mergeability of multiple pull requests at once. To do so, you have to use the batch_size option.&lt;/p&gt;

&lt;p&gt;If you set it to 5, the merge queue will create a rebased draft pull request and merge the commits of the five next queued pull requests.&lt;/p&gt;

&lt;p&gt;Then, to test all the commits from the five pull requests, Mergify will only run one single CI job instead of 5!&lt;/p&gt;

&lt;p&gt;If the CI passes: Mergify merges the five queued pull requests and closes the draft one.&lt;/p&gt;

&lt;p&gt;If the CI reports a failure: Using a binary search, Mergify builds two smaller batches of pull requests to check in order to find the culprit; for example, a batch of 3 and a batch of 2. Once the guilty pull request is spotted, Mergify kicks it out of the queue, and the rest of the pull requests are merged.&lt;/p&gt;

&lt;p&gt;Look at the demo below to see what it looks like when used.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/dc2_fZkJaVU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, the exponential increase in pull requests and consequent demand for Continuous Integration (CI) in a rapidly expanding project can present significant challenges, most notably increased CI times and associated costs. However, tools and strategies like the implementation of a merge queue, smart testing, and batch processing can effectively mitigate these challenges.&lt;/p&gt;

&lt;p&gt;A merge queue helps process pull requests sequentially, reducing the need for rebasing and the restart of CI jobs. This makes your CI process far more efficient and cost-effective. Additionally, a smart test strategy, which includes running unit tests immediately after creating a pull request and running more extensive tests only after a pull request reaches the top of the queue, can significantly reduce CI times and increase project velocity.&lt;/p&gt;

&lt;p&gt;The batch feature in Mergify's Merge Queue offers a game-changing advantage by checking the mergeability of multiple pull requests at once, reducing the number of required CI jobs even further. It smartly handles any CI failures by identifying and eliminating the problem pull request while seamlessly merging the others.&lt;/p&gt;

&lt;p&gt;With these features and strategies, the challenges of a growing project can be effectively managed, keeping your CI times and costs in check and ensuring the project's smooth and efficient progress.&lt;/p&gt;

</description>
      <category>cicd</category>
      <category>github</category>
      <category>productivity</category>
      <category>git</category>
    </item>
    <item>
      <title>What's a Merge Queue and Why Use it?</title>
      <dc:creator>Wakatepe-mergify</dc:creator>
      <pubDate>Thu, 17 Aug 2023 09:41:22 +0000</pubDate>
      <link>https://forem.com/wakatepemergify/whats-a-merge-queue-and-why-use-it-1b39</link>
      <guid>https://forem.com/wakatepemergify/whats-a-merge-queue-and-why-use-it-1b39</guid>
      <description>&lt;p&gt;That's a good question, isn’t it? Indeed, if it was only a little-known term a few months ago, merge queues would be more and more talked about. Between announcements from leaders like GitHub and real technical solutions, merge queues are increasingly adopted by software development teams.&lt;/p&gt;

&lt;p&gt;So, you'll be able to dive into this topic to understand what a merge queue is, in what situations they are useful, and how they work in practice.&lt;/p&gt;

&lt;p&gt;Are you ready for it? Let’s get started — you can also watch our video at the end of this article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Do We Mean by “Merge Queue”?
&lt;/h2&gt;

&lt;p&gt;Before wanting to know why you should work with a merge queue it is important to define what it is.&lt;/p&gt;

&lt;p&gt;Its name says all: a Merge Queue is simply a queue of Pull Requests waiting to be merged.&lt;/p&gt;

&lt;p&gt;Each member of your team creates Pull Requests, like a lot each day. Then the maintainers of the repository add it to the queue. Simple right?&lt;/p&gt;

&lt;p&gt;To be accurate, you are not just putting basic PRs in a queue. All the PRs present in the queue have been approved by maintainers. It means that they passed all the required checks.&lt;/p&gt;

&lt;p&gt;So you get a queue full of validated Pull Requests. Sounds cool, not really useful though. Why not just merge them, one by one? To give you an answer, let see first what common issues you will encounter if you do not use a merge queue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Do You Need a Merge Queue?
&lt;/h2&gt;

&lt;p&gt;To be honest, there are plenty of reasons and arguments to explain why you should bet on a merge queue. In this part, you will discover a really problematic situation and how you can solve it by using a merge queue.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Common Issue: Merging Outdated Pull Requests
&lt;/h3&gt;

&lt;p&gt;To understand the problem queues resolve, you first have to understand the issue. To do so, imagine the following situation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The main branch passes its continuous integration testing correctly.&lt;/li&gt;
&lt;li&gt;A pull request is created, which also passes the CI. Call it PR1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At this time, here is how you can represent the state of your repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pSRYEFdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6y6ayfng60unn83zv014.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pSRYEFdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6y6ayfng60unn83zv014.png" alt="Here is the state of your repository. Source: Mergify" width="800" height="263"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right now everything is totally OK, but it will not last. Let’s see.&lt;/p&gt;

&lt;p&gt;While PR1 is still open, another commit is pushed to the main branch. No matter if this newly created commit is pushed directly to the main branch or merged from another pull request. In fact, you just have to understand that the main branch has been modified.&lt;/p&gt;

&lt;p&gt;Then the tests are run against the main branch by the CI, and they pass again. At this point, you can describe the state of your repository and its continuous integration system like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ar_A4iH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j26whdkokyuj94t7jbum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ar_A4iH5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j26whdkokyuj94t7jbum.png" alt="A new commit has been pushed and merged into the main branch&amp;lt;br&amp;gt;
" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the PR1 is still marked as valid by the continuous integration system. Indeed, it is normal since it did not change. Only the main branch changed.&lt;/p&gt;

&lt;p&gt;As there is no code conflict, GitHub considers PR1 as mergeable: the merge button turns green.&lt;/p&gt;

&lt;p&gt;All happy you are, you smash that green button.&lt;/p&gt;

&lt;p&gt;But you saw that coming, you might have a surprise — and not a good one.&lt;/p&gt;

&lt;p&gt;Now that you want to merge PR1, a new merge commit is created and the continuous integration tests fail, but why?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X2YJAAAl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zebx3cut9n7k6ndcqcof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X2YJAAAl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zebx3cut9n7k6ndcqcof.png" alt="The CI test fails because the Pull Request does not have the last version of the code. Source: Mergify" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In fact, when PR1 was marked as valid, the CI did not test — again — PR1 with the new commit added to the main branch (remember it?).&lt;/p&gt;

&lt;p&gt;However, the last commit brought new tests in the main branch with him and now PR1 does not have the correct code to pass this new test. As sad as logical.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to Deal with this Situation?
&lt;/h2&gt;

&lt;p&gt;Basically, the problem is all about rebase and the necessity for each pull request to be up-to-date. If you do not use a Merge Queue, you have two options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only run your CI on the head of your feature branch — and do not require your feature branch to be up-to-date with the main branch.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;→ The main drawback here is that your feature branch might be or not compatible with the main branch.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Require all feature branches to be up-to-date with the target.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;→ The main drawback is that you waste a lot of time and money.&lt;/p&gt;

&lt;p&gt;That’s a quite common situation for organizations and teams working with CI/CD processes. If it is an issue, do not worry, you have found the real solution!&lt;/p&gt;
&lt;h2&gt;
  
  
  The Real Solution: a Merge Queue
&lt;/h2&gt;

&lt;p&gt;A promise is a promise, you’re not going to stay in this dead-end situation.&lt;/p&gt;

&lt;p&gt;Your solution: using a merge queue. Indeed, it solves that problem by updating any pull request before being merged. But only the ones that are not up-to-date with its main branch. Actually, a merge queue forces the CI system to test the PR again but with the new code from its main branch.&lt;/p&gt;

&lt;p&gt;In the previous situation, if you use a merge queue, it would automatically merge the main in the feature branch.&lt;/p&gt;

&lt;p&gt;As you can see below, the CI would have rerun. Then the pull request would have been marked as failing, and removed from the queue. Of course, if the PR was valid, and all the checks passed, it would have been merged.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XfZbmXBf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6cdwxiets6kaxkmxkn05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XfZbmXBf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6cdwxiets6kaxkmxkn05.png" alt="The merge queue merges the last tip of the main branch into the feature branch to update it. Source: Mergify" width="800" height="290"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another case of scenario: multiple pull requests are validated and ready to be merged.&lt;/p&gt;

&lt;p&gt;A merge queue will schedule their merging sequentially and ensure you that they are all updated on top of each other. Obviously, these updates are only done if the pull requests complete all the conditions.&lt;/p&gt;

&lt;p&gt;Nevertheless, what happens when you merge an updated pull request and then get another one which is still outdated. To ease your understanding, what about another illustration?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cM8P0Rii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdiqaa4g9q4hxe1h7626.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cM8P0Rii--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdiqaa4g9q4hxe1h7626.png" alt="Another outdated pull request has to be merged, just after a previous one. Source: Mergify" width="764" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A merge queue will make sure the second pull request is updated with the latest tip of the main branch before merging. By doing this, there is no way to merge an outdated and broken pull request into the main branch.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DI8Kn-o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1xpr3v19epgpywzc9g0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DI8Kn-o0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1xpr3v19epgpywzc9g0.png" alt="To merge the last outdated pull request, the merge queue merge again the main branch into the feature branch. Source: Mergify" width="800" height="271"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you repeat this as many times as necessary, for each outdated pull request in the queue.&lt;/p&gt;

&lt;p&gt;Life is not always easy, but a merge queue can make it a lot easier.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Does a Merge Queue Work?
&lt;/h2&gt;

&lt;p&gt;Now that you know what kind of issue a merge queue can solve, let’s summarize its functioning.&lt;/p&gt;

&lt;p&gt;As you probably understood, a merge queue looks more or less like a complex workflow we can analyze step by step.&lt;/p&gt;
&lt;h3&gt;
  
  
  1️. Queue Valid PRs
&lt;/h3&gt;

&lt;p&gt;Run the engine on your pull requests. All valid pull requests — the ones which validated all the conditions can be added to the queue.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. Update and CI
&lt;/h3&gt;

&lt;p&gt;The merge queue will make sure that each PR in the queue is up-to-date by merging the main branch into the feature branch.&lt;/p&gt;

&lt;p&gt;Then the CI rerun to make sure the PR is mergeable.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. To Merge or not to Merge, that’s the Question
&lt;/h3&gt;

&lt;p&gt;Two quite distinct cases:&lt;/p&gt;

&lt;p&gt;All checks passed → merge the PR.&lt;br&gt;
Failing test → remove the PR from the queue.&lt;/p&gt;
&lt;h2&gt;
  
  
  What About Mergify’s Merge Queue?
&lt;/h2&gt;

&lt;p&gt;In concrete terms, Mergify’s Merge Queue does everything you just read.&lt;/p&gt;

&lt;p&gt;It is one of the first merge queues launched on the market and already has thousands of happy users.&lt;/p&gt;

&lt;p&gt;While the common features presented before can solve many headaches, you may find yourself facing even more complex and specific situations. These situations require very specific functionalities.&lt;/p&gt;

&lt;p&gt;Good news, with Mergify, you already have them at your fingertips!&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Speculative Checks: Testing Different PRs in Parallel
&lt;/h3&gt;

&lt;p&gt;The first pull requests from the queue are embarked in a merge train and tested together in parallel so they can be merged faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tga63BP7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7cp5ppyvpsmd2rmy0si.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tga63BP7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7cp5ppyvpsmd2rmy0si.png" alt="How Speculative Checks Work" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Batches: Check and Merge Multiple PRs at Once.
&lt;/h3&gt;

&lt;p&gt;Mergify allows checking the mergeability of multiple pull requests at once using the batch_size option.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Multiple Queues: Put PRs in a Dedicated Queue.
&lt;/h3&gt;

&lt;p&gt;By using multiple queues, it’s possible to put some pull requests in a higher priority queue.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Queue Freeze: Stopping All Merging Processes.
&lt;/h3&gt;

&lt;p&gt;Mergify allows freezing the merge of one or several queues simultaneously to provide maximum control and flexibility on how and when you want the code to be merged.&lt;/p&gt;
&lt;h3&gt;
  
  
  ✅ Priority Management: Prioritize your Pull Requests.
&lt;/h3&gt;

&lt;p&gt;Choose which PR should be merged first, depending on labels, owners, etc. Your rules ultimately!&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo Video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6nHThSoFfVE"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Here you are folks, you should know everything about the concept of a merge queue. From how it works to why you should use one, merge queues have no secrets for you.&lt;/p&gt;

&lt;p&gt;It’s now time to try it and you know what? You can enjoy a 14-day trial for free with Mergify. I guess it’s your chance to say bye-bye to this outdated pull request issue.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>productivity</category>
      <category>github</category>
      <category>cicd</category>
    </item>
  </channel>
</rss>
