A team practising trunk-based development merges an unfinished checkout redesign into main and deploys it to production every day, but the redesign must stay invisible to customers until the product owner decides to release it, and it must be switchable off in seconds without a new deployment. Which technique satisfies the need to deploy the code yet control its release independently?
- AWrap the redesign in a feature flag evaluated at runtime, ship the flag off so the code deploys daily but stays hidden, and let the product owner flip it on or off instantly with no redeploy. Correct
- BKeep the redesign on a long-lived feature branch and merge it to main only on the day the product owner approves release, then deploy that merge to production.
- CWrap the redesign behind a feature flag stored in a deployment-time pipeline variable, and run a fresh release with the variable set to on when the product owner approves the change.
- DPlace the redesign inside a separate microservice that is only started in production once the product owner is ready for customers to begin using the new checkout experience.
Why A is correct: A runtime feature flag separates deploy from release, so the unfinished code reaches production behind an off flag every day and the product owner toggles exposure instantly without any new deployment, exactly as required.
Why B is wrong: A long-lived feature branch defers the merge but conflicts with the trunk-based daily-deploy practice stated, and it still ties release to a deployment rather than giving a runtime switch the owner can flip instantly.
Why C is wrong: A pipeline variable can gate code, but because it is bound at deployment time, flipping it on or off requires a new release, so it fails the requirement to switch the feature in seconds without deploying again.
Why D is wrong: Splitting the work into a microservice that is started on demand is heavier architecture and changes the deployment unit, which does not match a single trunk-based service needing a simple runtime on-off switch.