Problem
Long-lived feature branches diverge, producing painful merges, late integration bugs and release freezes. Teams delay shipping because merging is risky, which makes each merge bigger and riskier.
Also known as: tbd, mainline-development
Integrate small changes into a single shared branch at least daily, keeping it always releasable and hiding unfinished work behind flags.
Long-lived feature branches diverge, producing painful merges, late integration bugs and release freezes. Teams delay shipping because merging is risky, which makes each merge bigger and riskier.
Trunk-based development keeps all engineers working against one mainline. Branches, when used, last hours. The practice is a prerequisite for continuous delivery, and the DORA research links it to higher delivery performance.
Work is sliced into increments small enough to merge safely every day. Code merged but not ready is disabled by a flag or isolated behind an interface that still routes to the old implementation.
main: --o--o--o--o--o--o--o--> (always green, deployable)
\ / \ /
o o short-lived branches (under 1 day)
Pre-merge checks run unit tests and linting in minutes. Post-merge pipelines run slower suites and deploy. If main breaks, the rule is revert first and investigate second.
if flags.enabled("new-checkout", user):
return new_checkout(cart)
return old_checkout(cart)
Medium - fast CI capacity
Low - fewer branches and merges to manage
Medium - flags and incremental design thinking
Broken main blocks the whole team
Dark features leak to users through misconfigured flags
Flag debt accumulates until behaviour is unpredictable