DEV: feature-flag implementation at app-level #2667
Closed
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.
NOT (YET) INTENDED FOR REVIEW/MERGE
UP FOR DISCUSSION
This pull request implements one possible re-usable approach to feature-flags. The idea here is that we can merge incremental PRs directly into main without making an incomplete feature user-facing, and then switch the feature to be enabled (or delete the applicable code blocks) down the road. This is an alternate to the long-lived feature branches as we've seen with image rotation that can become difficult to manage.
#2664 had implemented a single-use feature-flag, which inspired this more general approach. kecnry#7 then shows how that would be modified to use the implementation proposed here.
The general idea here is that anything that is not ready for use yet, can be disabled by default, but still exposed for developer testing with something like:
or within test blocks temporarily with:
We then can also put
v-if
statements anywhere in vue to hide/alter the applicable sections of the UI, orif app._ff_is_enabled('my-feature')
in python to raise NotImplementedErrors, etc.Milestones and changelogs: if we go in this direction, how should the changelog and milestones be handled? Can we milestone these into a separate section of the changelog entirely and then somehow just go move the necessary entries? Should we have a milestone for each active feature we're working on so that a specific release version doesn't have to be targeted yet?