The more your branches diverge, the scarier your merges and releases become. Trunk-based development keeps everyone integrating into main continuously; feature flags let unfinished work ship dark and be turned on later.
Deploy is not release
With flags, code reaches production disabled. You deploy many times a day and release a feature by flipping a flag - to internal users first, then a percentage, then everyone.
if flags.enabled('new-checkout', user=user):
return new_checkout(cart)
return legacy_checkout(cart)- Short-lived branches (hours to a day), merged behind flags
- Flags have owners and a removal date - delete them once rolled out
- Percentage rollouts double as a canary for correctness
flags:
new-checkout:
default: false
rules:
- segment: internal
value: true
- percentage: 10Separate deploy from release and most 'release night' risk simply evaporates.
The discipline is deleting stale flags - an un-removed flag is tech debt with a conditional attached. Track them like any other work item.