Trunk-Based Development with Continuous Deployment

Organizational, technical, and cultural changes required to adopt TBD with CD, and how to sequence them.

Overview

Overview

Trunk-based development with continuous deployment requires sequenced investment in safety mechanisms before shortening branch lifetimes. Build the safety net first, then reduce branch lifetime, then enable progressive delivery.

The three phases

  • 1. Safety net — Feature flags so incomplete work merges hidden, automated rollback, a coverage gate that blocks merges
  • 2. Branch lifetime reduction — Branches live under 24 hours, merged branches auto-deleted, flag-gated vertical slices
  • 3. Progressive delivery — Canary deployments with observability-gated promotion and automatic rollback

> [!IMPORTANT] Order matters: shortening branch lifetime before the safety net exists puts unfinished and unsafe work straight onto trunk.

Adjacent practices

  • Flag lifecycle management — Every flag gets a TTL so flags do not become permanent conditional branches
  • Expand-contract migrations — Schema changes ship across separate deployments, never combined with a breaking code change

Interview questions

  • Your team wants to adopt trunk-based development with continuous deployment. What organizational, technical, and cultural changes are required, and how do you sequence them?
  • What is feature flag debt and how do you prevent it?
  • How do you handle database migrations in a CI/CD pipeline for high-traffic production systems where zero-downtime is required?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio