Contra chose Mergify to improve its developer velocity and start saving time to focus on the core project through automation, learn how.
Remote-only
A consistently high volume of PRs merging.
A Manual process.
Breakages on their main branch.
Company's description
Contra is a professional networking platform designed to give everyone the freedom and opportunity to work independently. The company's platform provides flexible work opportunities via an exclusive professional community and referral network by showcasing work portfolios, thereby enabling freelancers and other independent professionals to earn a living on their own terms. Founded in 2019, Contra is a remote-only organization with employees located across the globe and currently have 22 members in their engineering team.
What Was the Problem?
As a company, they are always looking for solutions to help them to improve their work and developer experience. They heard about the merge queue concept and started looking to integrate it into their build process.
The challenges they faced:
- A consistently high volume of PRs merging (from engineers & dependency updates). Contra deploys to production with every PR, and with an average count of 39 deployments per day and growing, they faced long merge times, especially during peak work hours. Thanks to Mergify’s Batch and Speculative Checks features, they can have up to 15 PRs safely merge in a single commit and deployment, keeping queue times reasonable and engineers happy.
- A Manual process. Contra recognizes that if things have to be done manually, ''I have to manually review this'', ''I have to manually merge that'' etc.. it’s easy for things to get missed or happen slower. That's a big deal for them because they tend to create a PR and ship it in less than 1 day and their goal is to be able to do it even faster.
- Breakages on their `main` branch. Merged regressions (pass on a branch, fail on `main`) are distracting and make it harder to deliver on our commitments. Having a merge queue in their branch that is testing the last changes of `main`, and then holding it, everything passes and then merges to `main`, so they don't have to test `main`. It's cool but if they prefer to have everything tested in the merge queue, they don't need to test `main`, and they can run their final pre-flight checks before the deployment. It keeps it always green.
Doug Schlenker - VP of Engineering @ Contra
Contra
Mergify allows us more time to focus on our core product and build a better experience for our users.
Contra's Workflow Now, Mergify Included
Today their workflow starts with engineers picking a task in Linear. They create a PR branch, and work through the requirements of the linear task.
They create a pull request when they are near completion. If they are creating the pull request before it's ready to review it goes up as a draft, and when it's ready for review they put it into the ''ready for review'' state.
They assign their GitHub team to it and GitHub chooses the participant to review the code. Internal tools notify engineers to do the review and once it’s reviewed and all of their status checks pass, mergify takes control to automatically merge and deploy the PR.
Contra has a rule that if something is trivial in size (a couple lines of code) and complexity, they can label the PR as “self-review”. If all status checks pass in GitHub, Mergify merges in automatically & deploys. With this process, there is a productivity incentive to ship small changes and controls are in place to make sure that the self-review process is used correctly.
When a hot-fix is needed to ship quickly to production, Contra uses a “hotfix” label and the PR goes into a special Mergify queue that has a higher priority so it will ship faster.
If a merge conflict happens, Mergify automatically attaches a GitHub comment on the PR which the pull request author sees within Slack in real-time.
What about gains?
With Mergify’s automation and merge queues, Contra's engineering organization has dramatically increased its shipping velocity by automating the build, merge & deploy process of small, trivial PRs. This was a game-changer.
They also get automatic merging of passing PRs from Renovate (a dependency management tool) with Mergify. It reduces the time sink incurred by dependency management significantly.
Contra's engineers have dramatically reduced `main` breakages via the Mergify merge queue.
Let's dive into some metrics:
- Cycle time: 23 hours on average.
- Throughput: 158/week. Their next goal is to hit 200 deployments in a week.
- Merge time: 5 hrs on average (an area they are working on to improve)
- Deployments: 39 deploys/day on average.
- Overall they have experienced time savings which gives them more time to focus on their core product and build a better experience for their users.
Doug Schlenker - VP of Engineering @ Contra
Contra
Spend a lot of time reading the documentation and learning the capabilities that can be unlocked in the mergify.yml. Out of the box, you have a simple basic merge bot but with time & experimentation, Mergify can adapt to your engineering processes and make everyone more productive.