Deploying your Merge Queue
Smoothly transition to Mergify while optimizing the merge queue and potentially moving to Mergify exclusive merges.
Deploying and transitioning to Mergify's Merge Queue involves two potential phases, each corresponding to different organizational preferences and maturity with the tool:
Hybrid Phase: This phase allows for a mix, where manual merges and Mergify coexist, aiding teams in the transitional period. This approach does not disrupt existing workflows drastically and lets teams gradually adapt to the automated merge queue.
Exclusive Mergify Merge Phase: In this phase, organizations can choose to enforce that only Mergify merges the pull requests, leveraging GitHub Branch Protection settings. This ensures a more streamlined, organized, and automated approach to merging.
None of those phases are mandatory, and they are defined here mostly as guidelines to inspire what your deployment scenario could be, and what your final workflow could look like.
In the hybrid phase, while the automated queue is in place, developers can still merge manually as usual. This flexibility is especially useful when transitioning gradually, ensuring minimal disruption to existing workflows.
Queue Disruption: Manual merges might interrupt the flow of the automated merge queue, making the process less optimal.
Extra CI Time: When manual merges bypass the queue, it might reset the jobs scheduled in Mergify, resulting in additional CI time and resource usage.
Educate the Team: Brief the team on the new Mergify queue system and its benefits, encouraging them to prioritize the queue over manual merges.
Monitor Usage: Regularly check how often the queue is being bypassed and encourage more use of Mergify for merging. You can monitor usage by checking who merged a pull request and notify someone when the queue is bypassed using an automation rule:pull_request_rules:- name: notify on manual mergeconditions:- merged-by!=mergify[bot]actions:comment:# replace <your-username> by your GitHub loginmessage: Hey @<your-username>, this PR has been merged manually.
Gather Feedback: Understand any resistance or issues the team is facing with using the Mergify queue and address them promptly.
Once the team is comfortable with Mergify, you can choose to enforce Mergify exclusively for merging pull requests through GitHub Branch Protection settings.
Go to Repository Settings: Navigate to
Settingsin your repository and locate the
Create/Add a Branch Protection Rule: Click on
Add ruleand configure the rule for the branch you wish to protect, typically
Configure Status Checks: Under the rule, enable
Restrict who can push to match branchesand add Mergify as the authorized user.
Save Changes: After configuring, click
At Mergify, our mission is to ensure consistent and uninterrupted service to aid your development processes. While we pride ourselves on our robust and resilient infrastructure, we also believe in transparency and preparation.
While the scenario painted here is improbable and not one we foresee, it's always wise to be prepared. Rest assured, with Mergify, even in the rarest of circumstances, your workflow remains in your control. Our commitment is not just to provide an exceptional service but also to ensure you're equipped for every eventuality.
Let's address the elephant in the room: though it's a scenario we've worked hard to avoid and has never occurred, an outage, however brief, remains within the realm of possibilities. In the unlikely event of such an interruption, it's essential to understand that your development and deployment will not come to a halt.
Manual merges are always an option: Even if Mergify is momentarily unreachable, you can merge your pull requests manually. This ensures that your workflow remains uninterrupted.
Admin privileges remain supreme: In instances where Mergify is the only authorized application to merge, administrators can still override branch protection settings and enforce a merge. Your admin privileges grant you the autonomy to take the necessary actions.
Branch protection flexibility: If needed, branch protection can be temporarily disabled, allowing your engineering team to merge pull requests manually and bypass the merge queue. This is a contingency to ensure your operations don't stall, even for a moment.
Transitioning to Mergify can be a smooth process, whether you choose to operate in a hybrid mode initially or move directly to exclusive Mergify merges. By configuring appropriately and addressing the team's needs and concerns during the transition, you can ensure a more efficient, orderly, and automated development workflow.
Remember, the transition to Mergify is not just about enforcing new tools but about optimizing workflows and fostering a collaborative and efficient development environment. Take the time to educate, adapt, and make the most out of Mergify's capabilities!