Agent Wranglers

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

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.