nayaread
HomeFavouritesTopicsSources
HomeFavouritesTopicsSources
NayaRead links to original engineering blogs. All copyright belongs to the respective authors.
Shopify Engineering·Nov 14, 2019·11 min read51

Successfully Merging the Work of 1000+ Developers - Shopify

Collaboration with a large team is challenging, and even more so if it’s on a single codebase, like the Shopify monolith. Shopify changes 40 times a day. We follow a trunk-based development workflow and merge around 400 commits to master daily. There are three rules that govern how we deploy safely, but they were hard to maintain at our growing scale. Soft conflicts broke master, slow deployments caused large drift between master and production, and the time to deploy emergency merges slowed due to a backlog of pull requests. To solve these issues, we upgraded the Merge Queue (our tool to automate and control the rate of merges going into master) so it integrates with GitHub, runs continuous integration (CI) before merging to master keeping it green, removes pull requests that fail CI, and maximizes deployment throughput of pull requests. Our three essential rules about deploying safely and maintaining master: Master must always be green (passing CI). Important because we must be able to deploy from master at all times. If master is not green, our developers cannot merge, slowing all development across Shopify. Master must stay close to production. Drifting master too far ahead of what is deployed to production increases risk. Emergency merges must be fast. In case of emergencies, we must be able to quickly merge fixes intended to resolve the incident. Merge Queue v1 Two years ago, we built the first iteration of the merge queue inside our open-source continuous deployment tool, Shipit. Our goal was to prevent master from drifting too far from production. Rather than merging directly to master, developers add pull requests to the merge queue which merges pull requests on their behalf. Merge Queue v1 Pull requests build up in the queue rather than merging to master all at once. Merge Queue v1 controlled the batch size of each deployment and prevented merging when there were too many undeployed pull requests on master. It reduced the risk of failure and possible

DevOps
Read original on shopify.engineering

Score breakdown

  • Technical depth69
  • Practical value60
  • Originality85
  • Writing quality93
  • Source reputation0
  • Recency0
  • External engagement0
  • On-site engagement0

NayaRead shows a summary and links to the original article. The full article is hosted on shopify.engineering.

More like this

Shopify Engineering

Automatic Deployment at Shopify - Shopify

Oct 19, 2016·9 min read
Shopify Engineering

How we use git at Shopify - Shopify

Aug 24, 2011·8 min read
Shopify Engineering

Scaling Mobile Development by Treating Apps as Services - Shopify

Jan 16, 2020·6 min read
Shopify Engineering

Spark Joy by Running Fewer Tests - Shopify

Jun 11, 2020·10 min read