Repository navigation
refactor(feature-flags): plain cached reads, no usage tooling - #579
Merged
Merged
Conversation
added 3 commits
October 26, 2026 19:30
Cut the flag system down to what it needs. The per-process snapshot store, the Redis version token, the memory store and their settings give way to one Rails.cache read with a 10 s TTL, memoised in Current per request or job and dropped by FeatureFlags::Admin after commit. CODER_REAP_ENABLED keeps locking coder_reap, now through a single `env:` registry field parsed like FEATURE_<KEY>, instead of the coder.reap_enabled settings bridge. Removed: FeatureFlags::Lifecycle and the feature_flags rake tasks, Admin.prune and the orphaned-rows UI, the "same everywhere" detection, the source-scanning registry test, Resolution#shadowed, registry substitution in tests (with_feature_registry, the example registry, SUITE_GRAPH) and the research doc. Tests set values as rows; the ENV layer is the only process-wide substitution left. Signed-off-by: Aixle Flow <[email protected]>
Signed-off-by: Aixle Flow <[email protected]>
…per request Signed-off-by: Aixle Flow <[email protected]>
NOX73
force-pushed
the
feature/feature-flags-simplify
branch
from
October 27, 2026 10:42
184897b to
4a93b29
Compare
The initializer now calls FeatureFlags.booted instead of boot!. In production eager loading reaches FeaturesResource, which reads the registry and composes the graph first; boot! composed it again and reported every undeclared FEATURE_* variable twice. Signed-off-by: Rozhnov Alexandr <[email protected]>
NOX73
force-pushed
the
feature/feature-flags-simplify
branch
from
October 27, 2026 10:45
4a93b29 to
abee03a
Compare
…cals Parse config/feature_flags.yml with aliases: false, as FeatureFlags::Registry.load does, so the two parsers agree. Signed-off-by: Aixle Flow <[email protected]>
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 28, 2026
* origin/develop: docs(workflows): describe workflows as sessions made of steps (AixleHQ#595) feat(workflows): open archived workflows read-only in the builder (AixleHQ#594) feat(task-comments): let authors delete their own recent comments (AixleHQ#593) feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592) fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591) feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590) feat(overview): show tokens used and session time instead of token cost (AixleHQ#589) fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587) test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586) test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584) feat(runners): add the runners table and the Runner model (AixleHQ#583) refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579) # Conflicts: # CHANGELOG.md
artempartos
added a commit
to Hitin/flow
that referenced
this pull request
Oct 28, 2026
* origin/develop: docs(workflows): describe workflows as sessions made of steps (AixleHQ#595) feat(workflows): open archived workflows read-only in the builder (AixleHQ#594) feat(task-comments): let authors delete their own recent comments (AixleHQ#593) feat(mcp): log the JSON-RPC method and tool name of each MCP call (AixleHQ#592) fix(board): show a run waiting for a session slot as Queued on its card (AixleHQ#591) feat(brand): use the new Aixle Flow lockup and route fonts through tokens (AixleHQ#590) feat(overview): show tokens used and session time instead of token cost (AixleHQ#589) fix(agents): pre-acknowledge Claude Code's cost-threshold notice (AixleHQ#587) test(playwright): QA helpers batch 2 (appRequest, readInertiaPage, shot, probeRoutes, signOut) (AixleHQ#586) test(playwright): plain-JS QA helpers for browser_run_code on staging (AixleHQ#584) feat(runners): add the runners table and the Runner model (AixleHQ#583) refactor(feature-flags): plain cached reads, no usage tooling (AixleHQ#579) # Conflicts: # CHANGELOG.md
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.
Task #180: cut the feature flag system down to what it needs.
What changed
Read path (§1).
FeatureFlags::Store,VersionToken,MemoryStore,Snapshot, the dedicated Redis client and theFEATURE_FLAGS_REFRESH_INTERVAL/FEATURE_FLAGS_MAX_STALENESSsettings are gone.FeatureFlags.snapshotis nowRails.cache.fetch("feature_flags/snapshot", expires_in: 10.seconds) { FeatureFlag.load_snapshot }, memoised inCurrentper request or job, with no memo outside an executor run (Temporal activities).FeatureFlags::AdmincallsFeatureFlags.changed!(a cache delete) after its transaction commits.FeatureFlag.load_snapshotreturns a plain frozen hash.Second ENV variable (§2). The registry has one optional
env:field (coder_reap: env: CODER_REAP_ENABLED) in place ofenv_setting+env_setting_variable. It is validated as an upper-case variable name that is notFEATURE_*and that no other flag claims.config/settings.ymlcollects theFEATURE_*variables plus the declaredenv:variables, reading their names fromconfig/feature_flags.yml.EnvSourceparses both the same way, andFEATURE_<KEY>wins when both are set.coder.reap_enabledand the settings-tree reading are removed. Intended behaviour change: aCODER_REAP_ENABLEDvalue other than on/off/true/false/1/0 now fails boot (CHANGELOG entry added).Usage and removal tooling (§3). Removed
FeatureFlags::Lifecycle,lib/tasks/feature_flags.rake,Admin.prune, the orphaned-rows section with itsDELETE /admin/feature_flags/:keyroute, the "same everywhere 30+ days" badge, the source-scanning half of the registry test, andResolution#shadowedalong with its "Shadowed" column.Overviewkeeps what the index shows plus the past-remove_bybadge, shown on release flags only.Test seam (§4).
FeatureFlags.with(env:)is the only seam left, used bystub_feature_env(key, value, variable: nil), which can simulate either variable. Removedwith_feature_registry,uses_feature_registry, the example registry fixture,SUITE_GRAPH,reinstall_suite_graph!,stub_feature_env_settingandFakeFeatureFlagVersionToken.with_featurewrites rows inside the test transaction. Facade and web tests use the real flags:external_runners(company scope) andcoder_reap(global, withenv:). Machinery tests build in-memory registries. No test needed a test-only flag at the facade level. Newtest/services/feature_flags/read_path_test.rbchecks that a request reads once, that a write is visible on the next request, that a missed delete heals after the TTL, and that nothing is memoised outside an executor run.Docs (§5).
docs/architecture/feature-flags.mdis rewritten as a short guide. The research doc is deleted and no longer linked. Also updated:docs/reference/configuration.mdand its portal copy, the Coder user guide and its portal copy,docs/operations/releasing.md,docs/index.mdand the CHANGELOG.One existing test changed bound:
aixle_builder_controller_testN+1 guard goes from 23 to 25 queries. Thefeaturesprop now loads the flag rows once per request, and the test cache is a null store. The count is constant per request.Line counts
app/services/feature.rb,feature_flags.rb,feature_flags/*.rb)Tested
On a Coder workspace, at head
521ce44f:bundle exec rubocopon every changed Ruby file: no offenses.bin/rails test, 4 parallel workers: 8,854 runs, 0 failures, 0 errors.How to test manually
On
/admin/feature_flags, set and clear the global value, add and remove an override, and turn a flag off everywhere. WithCODER_REAP_ENABLED=false, thecoder_reappage shows "Locked by CODER_REAP_ENABLED". WithCODER_REAP_ENABLED=yes, boot fails and names the variable.