liveBook · Manning

Trunk-based development

As explained in Effective Platform Engineering

Trunk-based development is a version-control practice in which developers integrate small changes frequently into a shared mainline.

Trunk-based development integrates small changes frequently into a shared mainline. Platform teams preferably pair-program and push directly to trunk, while short-lived story branches or pull requests remain acceptable when changes merge at least daily, preferably more often. section 6.3.3

Apply the practice by:

  • Keeping branches short-lived rather than allowing long-running divergence. section 6.3.3
  • Merging changes frequently into main, ideally through direct pushes or GitHub pull requests. section 6.3.3
  • Treating infrastructure pipelines as software pipelines, with integration connected to a fixed path toward production. section 6.3.3
Figure 6.10 Well-architected Infrastructure-as-code pipelines are no different from well-architected regular software pipelines. This is why we prefer the term “software-defined infrastructure” to differentiate between simply using an infrastructure-as-code (IaC) framework like Terraform and the software engineering practices that are a part of sustainable, high-quality software developer lifecycle management of an engineering platform product.
A screenshot of a diagram

AI-generated content may be incorrect.

Compare trunk-based infrastructure work with broader software-pipeline practices such as testing, static analysis, and staged deployment. section 6.3.3

How Effective Platform Engineering covers it

How deep it goes
Specifies pair programming, short-lived branches, and daily-or-more-frequent merges, without detailing branching mechanics or conflict resolution.
Examples
Uses platform-team pushes to trunk, short-lived GitHub story branches, and infrastructure changes progressing through a sandbox environment.
What you can do after
Apply it by merging platform changes frequently into main while preserving a stable, recurring release path.
How it connects
Connects pair programming, pull requests, continuous integration, infrastructure pipelines, and continuous deployment.

Also explained in

Compare how 4 books explain trunk-based development →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Platform Engineering. The section links point to the parts of the book it draws on.