Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Feature flags as a concept #506

Merged
merged 6 commits into from
Nov 30, 2024
Merged

Introduce Feature flags as a concept #506

merged 6 commits into from
Nov 30, 2024

Conversation

PragTob
Copy link
Collaborator

@PragTob PragTob commented Nov 30, 2024

This should fix #480

  • the first commit adds the feature flag context/helper
  • the latter 2 commits do some really light work that you may decide you may not want (number 3 in particular has some reasoning for it inside the commit but it's a taste thing, mostly 🤷 )

Other thinking:

  • the options key seemingly has feature flags and some full on options mixed with each other, instead of pre-fixing keys feature (and one post-fixed enabled) I think I'd put them into a sub-key (of options) feature_flags: [_flags_] but I don't know if we need to keep backwards compatibility here (not change the names, do people adjust this themselves or do they go via system envs?)
  • There is another feature/feature flag that is named feature_brainstorming_removal_after_days and holds a number of days, not a boolean - maybe we want to have this implementation as a more general Options module that then also has a function like get that just gets that option value? I'm unsure and would need input!

This one might feel odd. Well, it just felt odd to me that the
function would be called and then just return `nil` if the
feature flag was deactivated. I felt the function shouldn't
be called at all.

This way, for instance, if it was deactivated in the test
environment we could still test it etc - the behavior is still
there.

That's all debatable and more of a "I feel like this" kind of
thing.
@JannikStreek
Copy link
Member

nice, improves readability a lot

@JannikStreek
Copy link
Member

I would propose to split the other 2 thoughts in respective issues. I haven't understood 100% the first one, second point sounds like a good idea.

@JannikStreek JannikStreek merged commit 2cfb33e into master Nov 30, 2024
8 checks passed
@JannikStreek JannikStreek deleted the feature-flags branch November 30, 2024 21:31
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.

Chore: Create a feature flag context module to ease and centralize access to those
2 participants