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

Environment-specific feature rules #285

Merged
merged 10 commits into from
Mar 15, 2022
Merged

Environment-specific feature rules #285

merged 10 commits into from
Mar 15, 2022

Conversation

jdorn
Copy link
Member

@jdorn jdorn commented Mar 10, 2022

Currently, features have a single default value and list of rules that is shared between all environments. This makes it difficult to, for example, test an experiment rule in dev and then promote it to production. It's also difficult to have a separate value in dev vs production (e.g. a config value).

With this change, each environment will have its own list of override rules and it will be easy to copy rules between environments as needed. This PR will also set the stage for allowing custom environments beyond the default dev and production, although that will be implemented in a follow-up project.

TODO:

  • Add environmentRules to feature model
  • Make model backwards compatible with existing db schema
  • On the feature list page, add tabs to switch between the selected environment. Only show the selected environment's toggle in the table.
  • Persist last chosen environment when moving between list and detail pages
  • Update feature API and webhook payload to pull rules from the right place depending on environment
  • For old webhooks and api endpoints that have multiple environments selected, always default to production
  • Figure out what to do in initial feature modal when adding a rule (clone the rule to all toggled environments?)
  • New webhooks must select a single environment only
  • Add tabs to feature detail page to switch between environments for default value and override rules
  • Easy way to copy rules between environments
  • Dedicated API endpoints for CRUD operations on rules and toggling environments on/off.
  • Test /api/features endpoint
  • Test flow creating a new feature
  • Test editing rules
  • Test adding rules
  • Test re-ordering rules
  • Test deleting rules
  • Test copying rules between environments
  • Update docs

@vercel
Copy link

vercel bot commented Mar 10, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/growthbook/docs/9JMcHzJ6bBcLTzBWpvupMcT69ZUE
✅ Preview: https://docs-git-env-rules-growthbook.vercel.app

@jdorn jdorn marked this pull request as ready for review March 15, 2022 19:42
@jdorn jdorn merged commit ad818ce into main Mar 15, 2022
@jdorn jdorn deleted the env-rules branch March 15, 2022 19:47
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.

None yet

1 participant