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

Feat: set flags via rill.yaml #4329

Merged
merged 6 commits into from
Mar 13, 2024
Merged

Feat: set flags via rill.yaml #4329

merged 6 commits into from
Mar 13, 2024

Conversation

briangregoryholmes
Copy link
Contributor

@briangregoryholmes briangregoryholmes commented Mar 12, 2024

This PR enables the setting of feature flags via the rill.yaml file and updates the formatting expectations of localStorage keys to match the YAML and URL params.

  • Adds a "features" key to the YAML spec that takes a list of strings
  • Updates the FeaturesFlag store to use the new class based structure
  • Adds a subscriber function that listens for changes to the rill.yaml and updates keys accordingly
  • Adds a "system" or "user" scope to limit who can change feature flags
  • Updates rillYAML and RillYAML types in the platform code

As an example, if you add (or remove) the following in your rill.yaml:

features:
  - customDashboards

The UI should respond immediately (after a debounce) to toggle that feature on or off. Adding something like adminServer would not enable that feature as this flag has been created with system scope, but no warning is surfaced.

A flag needs only to be set in one location to be enabled, so if you have customDashboards set in the URL, localStorage and YAML, then it won't be turned off in the UI until it's removed from all three locations.

While this will not be a widely used feature, I would argue that we should remove the ability to set flags in the URL/localStorage now that it's enabled in the project YAML.

@briangregoryholmes briangregoryholmes self-assigned this Mar 12, 2024
@briangregoryholmes briangregoryholmes marked this pull request as draft March 12, 2024 21:30
@briangregoryholmes briangregoryholmes marked this pull request as ready for review March 12, 2024 21:53
Copy link
Collaborator

@nishantmonu51 nishantmonu51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 👍

@nishantmonu51 nishantmonu51 merged commit 29ba2ff into main Mar 13, 2024
6 checks passed
@nishantmonu51 nishantmonu51 deleted the bgh/yaml-flags branch March 13, 2024 13:15
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.

2 participants