Skip to main content

Published

Feature flag coverage use cases

In brief: Practical uses of feature flag coverage, each with the view or prompt to use. Check an arm before turning a rollout up, review untested arms in a release, test kill switches and experiment variants, and clean up flags safely.

Each use case below names the view or prompt to use. All of them assume setup is done and, for untested arms, that your provider is connected.

Before turning a rollout up​

You plan to take new-checkout from 10% to 50%. Before you do, check that the true arm has tests.

  • View: Insights → Feature flag coverage, scoped to the checkout stories. Each flag shows its rollout percentage in the test environment next to each arm.
  • What to look for: the arm you are rolling out marked Tested, with passing tests. Tested (forced) means the code path ran with that value, but not through your provider's targeting.

Release readiness​

  • View: the feature flag coverage panel on the release page shows {armsCovered} of {armsTotal} flag arms tested in this release, using the release's scope and executions.
  • Release checks: the untested arm count appears as an informational check. It does not block the release. See Release checks.

Kill switches​

A kill switch is only useful if the "off" arm works. Feature flag coverage lists both arms of a boolean flag, so an untested false arm shows up as a gap.

  • Prompt: use Copy agent prompt on the untested arm, or ask your agent: /testchimp fix coverage gaps for the kill-switch arm of payments-enabled on the checkout story.

Experiment variants​

Multivariate flags and experiments list every variant from the catalog. A pricing experiment with control, annual-first and monthly-first shows which variants have tests and which do not.

  • View: expand the story to see each variant, its rollout, its status and the tests that ran it.
  • Tip: prefer real targeting for the test user over mocking, so the arm shows as Tested rather than Tested (forced).

Before removing a flag​

Before you delete a flag and its losing arm, check that the arm you keep is the one your tests run.

  • View: find the flag under its stories and check that the kept arm is Tested. Archived flags stay visible, marked archived, so you can still see their history after you archive them in the provider.

Flags no story covers​

Some flags run in tests that are not linked to any story.

  • View: the coverage page lists them under Flags seen in tests with no linked story.
  • Agent: get-feature-flag-setup-status returns them as observedUnmappedFlagKeys. Link those tests to scenarios, or pin the flag to the right story.

A flag that matters but no test evaluates​

A story is about a flag, but its tests never reach the code that evaluates it. Auto relevance cannot find it.

  • Action: pin the flag to the story from the flag menu, or with set-story-feature-flag-relevance and state: PINNED. All its arms then show as untested until tests run them.
  • To hide a flag that is evaluated but irrelevant to a story, exclude it the same way with state: EXCLUDED.

Closing gaps with an agent​

Agents read the untested arms with get-feature-flag-coverage and write tests for them. Ask:

/testchimp fix coverage gaps: close the untested feature flag arms in plans/stories/checkout

To put the app into an arm, the agent tries, in order:

  1. Provider targeting for the test user or environment. This gives real frontend or backend evidence. The agent has no write access to your provider, so it proposes the targeting change for you to make.
  2. The app's own override, such as a query parameter, cookie or local storage key, found by reading your existing tests.
  3. Mocking the provider's response, which records the arm as forced. testchimp.flags.force() is used only when the value is pinned that way.

See Fix coverage gaps.

Ignoring a gap on purpose​

Some arms do not need a test, for example a variant that is only for internal users. Use Ignore gap on the arm. Ignored arms count as neither covered nor uncovered.

FAQ

How do I check a flag before increasing its rollout?

Open Insights, then Feature flag coverage, scoped to the stories behind the flag, and check that the arm you are rolling out is Tested with passing tests.

Does an untested arm block a release?

No. Untested arms are an informational release check, not a gate.

How does an agent put the app into a flag arm?

It prefers provider targeting for the test user, then the app's own override, then mocking the provider response, which records the arm as forced.