Repository navigation
feat(feature-flags): registry, resolver and Feature facade (1/7) - #526
Merged
Merged
Conversation
…acade First of the seven feature flag tasks (#166, design in #164). The registry ships empty, so nothing changes in behaviour. Signed-off-by: Aixle-Developer-Agent <[email protected]>
added 3 commits
October 21, 2026 13:16
…keys once - config/settings/test.yml empties feature_flags.env, and the per-test setup resets the ENV layer with the store, so a FEATURE_* value in the shell, CI or .env never reaches a test; stub_feature_env is the only way to lock one. - Feature reports an undeclared key to Sentry once per key per process instead of on every call; it still reads as off every time. Signed-off-by: Aixle-Developer-Agent <[email protected]>
…tever it holds Signed-off-by: Aixle-Developer-Agent <[email protected]>
6 tasks done
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 21, 2026
* commit '2ecb0ecb': fix(admin): keep form fields dark after a Turbo visit (AixleHQ#533) feat(overview): rename Total Spend card to Token Cost (AixleHQ#532) fix(admin): preload company session limits on the companies index (AixleHQ#523) fix(board): keep the board settings gear on the toolbar row (AixleHQ#524) feat(capacity): give every AWS Marketplace company at least 3 workers (AixleHQ#531) fix(mcp): refuse token changes while impersonating; error on a token no company accepts (AixleHQ#528) feat(feature-flags): registry, resolver and Feature facade (1/7) (AixleHQ#526)
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Board task #166 — first of the seven feature flag tasks from the research in #164 (report, PR #525).
What changed
config/feature_flags.yml— the registry, shipped empty (only a commented schema).FeatureFlags::Registry— loads the YAML once at boot, validates and freezes it. Fails boot (InvalidRegistry, every problem listed at once) on: a key not matching/\A[a-z][a-z0-9_]*\z/; a key mapping intoFEATURE_FLAGS_*(flags,flags_*); a missingdescription/owner/kind/scope/default; bad values for those; areleaseflag withoutremove_by; an unknown attribute.FeatureFlags::EnvSource— the ENV lock layer, read from the newfeature_flags:block inconfig/settings.yml(env,refresh_interval_seconds,max_staleness_seconds), soapp/**never readsENV.on|true|1/off|false|0, case-insensitive and trimmed; empty = unset; anything else fails boot (InvalidEnv) naming the variable. AFEATURE_*variable for an undeclared key only warns.FeatureFlags::Resolver— pure function of registry + ENV source + snapshot: ENV > company override > (reserved: rollout %) > global > declared default.company:required for company-scoped flags (nillegal, skips the override step); passing it to a global flag raisesArgumentError; undeclared key raisesFeatureFlags::UnknownFlag.Feature.enabled?(key, company:)/Feature.explain(key, company:)—explainreturns aFeatureFlags::Resolution(value, deciding source,env_var, shadowed layers). Nodisabled?, setters or block form. Unknown key raises in development/test; elsewhere returnsfalseand reports to Sentry.FeatureFlags::Snapshot+FeatureFlags::MemoryStore— the snapshot interface the resolver reads; the in-memory store is the only store until task 2.config/initializers/feature_flags.rbcallsFeatureFlags.boot!after initialization. UndeclaredFEATURE_*→ oneRails.logger.warn+Rails.error.reportper variable; both new sources (feature_flags.unknown_flag,feature_flags.undeclared_env) are added to the Sentry forwarding list inconfig/initializers/sentry.rb.test/support/feature_flags_helper.rb, included inActiveSupport::TestCase(so integration and system tests too): store reset insetup;with_feature,with_feature(..., company:),stub_feature_env, pluswith_feature_registryto declare test-only flags. No DB/Redis/real ENV; no vendor stubbing orany_instance.docs/reference/configuration.mdgets a Feature flags section withFEATURE_<KEY>,FEATURE_FLAGS_REFRESH_INTERVAL,FEATURE_FLAGS_MAX_STALENESS; portal copy refreshed (byte-identical, asdocs:sync_config_referencewrites it).Decisions
Rails.env.local?, so staging behaves like production.env_settingis not accepted yet (task 6 adds it).Resolution#shadowednever lists the declared default.How to test
Tests cover every row of §3.3 and all 11 worked examples of §3.4 using
test/fixtures/files/feature_flags_registry.yml(the shipped registry is empty).Not in this PR
DB tables/models, Redis version token,
Current.feature_snapshot(task 2); admin pages (3); frontend payload (4); lifecycle tooling and developer guide (5).