Skip to main content

Feature flags and trunk-based development

The actual argument

Feature flags don't remove long-lived branches by themselves. What they do is make trunk-based development possible: unfinished work can sit in main switched off, so there's no reason to keep it on a branch for weeks.

That's the causal chain worth remembering. Flags are the enabler, trunk-based dev is the thing you actually want.

The exception I hit

A whole-site stylesheet swap can't go behind a flag. A flag switches behaviour for some users, but a stylesheet is loaded once for everyone. Anything that changes globally like that needs a different release path, staged rollout or a straight cutover.

Worth checking before assuming a flag will cover a piece of work.

Where flag copy lives

Notification and description text for a flag belongs in the database next to the switch, not in code. Otherwise changing the wording needs a deploy, which defeats the point of having a switch.