Sans titre-5.jpg

Contra × Mergify

How did Contra become more productive with Mergify merge queue?

Summary

Challenges

  • Consistent high volume of PR’s merging (from engineers & dependency updates).
  • Manual process, easy for things to get missed.
  • Breakages on our main branch from merged regressions (pass on branch, fail on main).

Solution

  • Merge Queue.
  • Labels feature.
  • Automation.

Results

  • Cycle time: 23hrs on average with 158 deployments a week (sooner 200 a week).
  • Throughput: 158.7/week.
  • Deployments: 39 deploys/day on average
  • Time savings, giving them more time to focus on their core product and build a better experience for their users.

Who's Contra?

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 from people 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.
The company is based in San Francisco where it was created in 2019 (but fully remote). Contra has 22 engineers — and growing.

Capture d’écran 2023-01-30 à 11.33.35.png

What was the problem?

As a company, they are always looking for solutions to help them to improve their work. They eared about the merge queue concept and start looking to involved it in the building process.

They are constantly trying to prevent, and to do it they need to face:

  • A consistently high volume of PRs merging (from engineers & dependency updates). Because as an organization, even with 22 engineers, they create a lot of Prs daily, now their average is 39 deployments a day. They pretty much have a one-to-one relation of deployment and PRs getting merged in. But it starts to change thanks to Mergify Batch and Speculative Checks features cause they may have 3 PRs merged in a single commit.
  • Manual process. They recognize that if things have to be done manually, ''I have to manually review this'', ''I have to manually merge that'' etc.. that's easy for things to get missed or just slower. And that's a big deal for them cause they tend to create a PR and ship it in less than 1day and their goal is to be able to do it even faster.
  • Breakages on their main branch from merged regressions (pass on a branch, fail on main). 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.
1562683455281.jpeg

A simple basic merge bot but with time & experimentation, Mergify can adapt to your engineering processes and make everyone more productive.

Doug Schlenker - VP of Engineering at Contra

Contra's workflow now, Mergify included

Today their workflow starts with engineers picking a task in Linear. They create a PR branch or branch off of it and they work depending on requirements in the linear task. They pull up a PR, and if they are doing it before it's ready to review it goes to the draft, and when it's ready for review they put it into the ''ready for review'' state (AKA draft). They assigned their GitHub team to it and GitHub choose the right participant to review it. Internal tools notify engineers to do the review, once it's green, when they get the review, mergify takes control to automatically merge and deploy the PR.

They have this rule if something it's trivial with not many lines of code, they can put a label on this kind of PRs as “self-review”, and if all status checks pass in GitHub, Mergify merges in automatically & deploys. With this process, they encourage people to make smaller PRs.

If a merge conflict happens, Mergify automatically attaches a GitHub comment on the PR which the dev team sees in real-time.

After that, PRs go to the queue, pass status checks, get merged in and ArgoCD takes over to ship it to production, and production hot-fixes skip to the top of the queue to ship faster.

Capture d’écran 2023-01-30 à 15.53.30.png
1562683455281.jpeg

I can't even imagine how much time it saves per year!

Doug Schlenker - VP of Engineering at Contra

What about gains?

With Mergify automation and merge queue, Contra's engineers have dramatically improved their Developer Velocity when shipping small PRs, with the automatic merging of trivial PRs that they label as self-reviewed (zero risk, zero complexity). It was a game-changer.

They can get automatic merging of passing PRs from Renovate (dependency management tool) with Mergify. It reduces dependency management tech debt time by a significant amount.

Contra's engineers have dramatically reduced main breakages via the Mergify merge queue.

Let's dive into some metrics:

  • Cycle time: 23hrs on average with 158 deployments a week, and in fewer weeks thanks to Mergify tricks it will be around 200 a week.
  • Throughput: 158.7/week.
  • Merge time: 5 hrs on average (an area they’re working on to improve)
  • Deployments: 39 deploys/day on average.
  • Overall they are witnesses to many time savings, giving them more time to focus on their core product and build a better experience for their users.

Another fantastic thing for any team about developer experience; point is to get over things that take you away from the core focus of the product you are building, and in every company, you run after dependencies management. They are using renovate here. They run all their dependencies through all the status checks, they have a lot of tests and if it's a minor or patch dependency and it passed all the checks then Mergify merges it automatically.

Being able to get their dependencies constantly pop up and getting merged with a solution like Mergify allowing them to put rules around dependencies management is a massive saving for teams, they can't even imagine how much time it saves per year! Their long-term goal is to do the same with major ones.

Ready to get started?

Made with