← All insightsDelivery

Trunk-based development and feature flags

CodeWizard Engineering · 26 June 2025 · 3 min read · Intermediate

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.

python
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
yaml
flags:
  new-checkout:
    default: false
    rules:
      - segment: internal   
        value: true
      - percentage: 10
Separate 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.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult