ENG-25Recommended
Separate deploying from releasing
Ship unfinished or risky features switched off, and turn them on with a flag when they are ready.
How to do it
Wrap the new path in a feature flag read from settings or a flag service, for example through the OpenFeature standard. Default every flag to off, so a missing setting keeps the old behaviour. Turn it on for staff first, then for everyone. Test both paths while the flag exists. Remove the flag when it is fully on, as the dead code chapter explains. See also read feature flags before the first paint.
Examples
JavaScript example
const isNewCheckoutOn = flags.isEnabled('new-checkout', { user, defaultValue: false });
return isNewCheckoutOn ? renderNewCheckout(cart) : renderCheckout(cart);
Python example
is_new_checkout_on = flags.is_enabled("new-checkout", user=user, default=False)
return render_new_checkout(cart) if is_new_checkout_on else render_checkout(cart)
How to check
Deploy with the flag off. The old behaviour stays the same for users. Turning the flag on needs no deploy. Every flag in the code appears in the register of Keep every flag in one register.
Sources
Related rules
- ENG-12 Roll out settings and data files like code in Engineering
- ENG-14 Make small changes on short-lived branches in Engineering
- ARC-60 Remove flags that never change in Clean code and architecture
- APP-49 Read feature flags before the first paint in Web app interface
- ENG-45 Keep every flag in one register in Engineering
- ENG-47 Keep serving when the flag service is down in Engineering
- STK-96 Use a settings file for flags and Unleash when flags need targeting in Software choices
- SCL-32 Turn off optional work under load in Scaling
- TKO-14 Rewrite behind the old interface in Codebase takeover
- ANA-12 Assign each user to one variant for good in Product analytics and experiments
- ANA-15 Stop an experiment when a guardrail metric breaks in Product analytics and experiments
- APS-90 Keep a switch that turns the agent off in Application security
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/engineering/running-in-production/deploy-is-not-release">Agent Wranglers engineering playbook</a>. In code you write, add a comment next to it with the same link.