Developer workflows
How code moves from an idea to production in a team.
Developer workflows cover branching, local setup, reviews and releases. Friction there slows every feature. Fast feedback loops, such as quick local runs and fast tests, make the biggest difference.
Why it matters for a product engineer
Every feature goes through the same workflow: a branch, a review, CI, a merge and a release. Friction there is paid on every change. A product engineer who ships small changes often needs a workflow that makes small changes cheap.
How to do it
- Work in small changes on one main branch. DORA’s research links better delivery to three or fewer active branches, merges to the main branch at least once a day, and no code freezes.
- Decide how much review each change needs. Ship a routine change without a pull request. Show an interesting one in a pull request that you merge at once. Ask before merging when you need input.
- Make local setup one command, and keep the feedback loop fast: tests and checks that run in seconds on your machine.
- Protect the main branch with required checks, so it always builds.
- Hide unfinished work behind feature flags, not in long-lived branches.
- Ask the developers where they wait, and measure it.
Common mistakes
- Branches that live for weeks and end in a painful merge.
- The same heavy review for every change.
- A main branch that is often red, so nobody trusts it.
- Release steps that only one person knows.
Example
By 2016, nearly 1,000 pull requests a month merged into GitHub’s largest monorepo. They shipped in “trains”: a person, the conductor, grouped up to 15 pull requests, deployed them and handled the conflicts. Internal surveys rated deployment the most painful part of a developer’s day. GitHub replaced trains with a merge queue. The queue forms the groups, runs the checks and removes conflicting pull requests by itself. All production repositories used it by 2023.
GitHub's main monorepo after the move to a merge queue
- 2,500
- Pull requests merged each month
- By more than 500 engineers
- 30+
- Changes in one deploy when needed
- Trains allowed 15
- 33%
- Shorter average wait to ship a change
The work did not get smaller. The waiting did, because the queue does what the conductor did by hand.
ReportedWill Smythe and Lawrence Gripper, GitHub, 6 Mar 2024
Sources: How GitHub uses merge queue to ship hundreds of changes every day (GitHub) ↗ · Ship / show / ask (Rouan Wilsenach) ↗ · Trunk-based development (DORA) ↗
Resources
3- articleStart here
Ship / show / ask ↗
Rouan Wilsenach (martinfowler.com) · 2021 · 9 minNot every change needs a review before merging; a simple way to decide which do.
- docsGo deeper
Trunk based development ↗
Paul Hammant · free guideWorking in small changes on one main branch, the branching model behind fast delivery.
- docsGo deeper
Trunk-based development ↗
DORA (Google Cloud) · 7 minShort-lived branches and frequent merges, and how to tell whether your team really does it.
Tools
2- ToolFreemium
GitHub Actions
CI/CD built into GitHub, for running tests, checks and deployments on every change.
- ToolOpen source
Renovate
Open-source bot that opens pull requests to keep dependencies up to date.