Skip to content

Add FeatureEnabled expression for feature dependencies#970

Merged
jnunemaker merged 3 commits intomainfrom
flag-in-expression
Feb 17, 2026
Merged

Add FeatureEnabled expression for feature dependencies#970
jnunemaker merged 3 commits intomainfrom
flag-in-expression

Conversation

@jnunemaker
Copy link
Copy Markdown
Collaborator

Add FeatureEnabled and FeatureDisabled expression types to enable composing feature flags as prerequisites or migration patterns.

Features:

  • Flipper.feature_enabled(:name) — Check if another feature is enabled
  • Flipper.feature_disabled(:name) — Check if another feature is disabled
  • Circular dependency protection (A → B → A returns false, not infinite loop)
  • Actor passthrough — Feature dependencies inherit the actor context
  • Full composition with Any and All expressions

Changes:

  • New FeatureEnabled expression class with circular dependency detection
  • DSL helpers feature_enabled and feature_disabled in Flipper module
  • Gate context now includes actor: for expressions that need it (backward-compatible)
  • 10 integration tests covering enabled/disabled states, circular deps, composition

Testing:
All 2775 examples pass (includes 10 new tests).

jnunemaker and others added 3 commits February 16, 2026 19:28
Allow expressions to reference other feature flags' enabled state via
Flipper.feature_enabled(:name) and Flipper.feature_disabled(:name).
This enables composing feature flags as prerequisites or migration patterns.
Includes circular dependency protection via thread-local tracking.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Move begin/ensure to wrap the early return path so the thread-local
evaluating set is always cleaned up, even when a circular dependency
or self-reference triggers the early return. Added tests to verify.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The KeisukeYamashita/memcached-actions@v1 action was failing in CI.
Use a Docker service container instead, consistent with how redis
and postgres are already configured.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnunemaker jnunemaker merged commit 0e19a53 into main Feb 17, 2026
46 checks passed
@jnunemaker jnunemaker deleted the flag-in-expression branch February 17, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant