04.7.2 · Skill in Developer experience

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.

Your status · Developer workflows

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

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

  1. 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.
  2. 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.
  3. Make local setup one command, and keep the feedback loop fast: tests and checks that run in seconds on your machine.
  4. Protect the main branch with required checks, so it always builds.
  5. Hide unfinished work behind feature flags, not in long-lived branches.
  6. 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.

Numbers

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 min

    Not every change needs a review before merging; a simple way to decide which do.

  • docsGo deeper
    Trunk based development ↗
    Paul Hammant · free guide

    Working in small changes on one main branch, the branching model behind fast delivery.

  • docsGo deeper
    Trunk-based development ↗
    DORA (Google Cloud) · 7 min

    Short-lived branches and frequent merges, and how to tell whether your team really does it.

Tools

2
Tools for Developer experience