liveBook · Manning

Feature flag

As explained in GitHub Actions in Action: Continuous integration and delivery for DevOps

A feature toggle is a runtime-controlled switch that selectively enables or disables a software capability independently of deployment.

A feature flag, or feature toggle, is a runtime-controlled switch that separates deployment from release. Software can be installed on production servers while the changed capability remains hidden; changing the switch later exposes the new implementation without redeploying. section 9.3.5

In its simplest form, a flag selects between old and new code with an if statement. Keep the old behavior active after deployment, validate that production still operates as before, then enable the new behavior when ready. If the change causes problems, turn the flag off to restore the old version. section 9.3.5

Feature flags support a controlled release workflow:

  • Deploy artifacts independently from exposing their new capabilities to users. section 9.3.5
  • Validate production behavior before enabling a changed implementation. section 9.3.5
  • Roll back visible behavior by disabling the flag rather than reinstalling software. section 9.3.5
  • Expose functionality gradually to selected user groups or rings. section 9.3.5

Canary exposure with a flag

Enable a new capability for a small initial group and monitor whether the application behaves as expected. If anomalies appear, disable the feature to preserve normal operations. If telemetry remains healthy and no live-site incidents occur, expose the next ring after an appropriate observation period. section 9.3.8 section 9.3.5

Flags can work alongside traffic routing. Traffic routing directs requests to a new server version, whereas a feature flag controls whether changed behavior is revealed within deployed software. Combining them supports more advanced staged-release scenarios. section 9.3.5

Figure 9.6 Ring-based deployment

Use the ring-based deployment diagram to relate progressive user exposure, monitoring, and the decision to advance or disable a feature. section 9.3.8

How GitHub Actions in Action: Continuous integration and delivery for DevOps covers it

How deep it goes
Explains switch-based old/new code selection, production validation, rollback, and gradual exposure without prescribing a flagging system.
Examples
Uses old-versus-new code switching and a monitored canary rollout through successive user rings.
What it assumes
Assumes an application design with a mechanism to select users or route traffic to deployment rings.
What you can do after
Operate/configure it to stage production exposure and restore prior behavior by disabling a switch.
How it connects
Connects feature flags with continuous delivery, traffic routing, canary releases, ring-based deployments, monitoring, and telemetry.

Also explained in

Compare how 8 books explain feature flag →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GitHub Actions in Action: Continuous integration and delivery for DevOps. The section links point to the parts of the book it draws on.