CI/CD Best Practices

Chapter 1 of 6 · 4 practices · 3 min · 3-question quiz

Integrating small changes often

How code should flow into main so that integration is continuous in practice, not just in name: trunk-based development, small batches and a main branch that is always releasable.

Start: Merge small changes into main at least once a day

4 practices in this chapter

  1. 1Merge small changes into main at least once a dayDORA's trunk-based development guidance describes teams that merge small, frequent changes into a single main branch rather than living on long feature branches. Its concrete markers are: Long-lived…
  2. 2Keep main releasable, and revert first when it breaksContinuous integration only works if main is green almost all the time. DORA's trunk-based guidance says to fix or revert failing changes quickly, so the build stays usable for everyone else.
  3. 3Review small pull requests quicklyDORA lists heavyweight code review as a common trunk-based pitfall. When reviews need several approvals or wait a day, developers batch more work into each pull request to avoid the wait, which makes…
  4. 4Define the pipeline as code next to the applicationA pipeline configured by clicking in a web UI cannot be reviewed, versioned or restored. Keep workflow files in the repository, where changes go through the same review as the code.

Check yourself on this chapter

3 questions, right here once you are signed in. Your progress is saved as you read.

Sign up for the quiz