-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🪟 🔧 Allow overwriting features in dev by env variables #20231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just a couple of questions and... should we add a test for this as well?
}); | ||
|
||
afterEach(() => { | ||
(process.env.NODE_ENV as string) = "test"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Need to cast this, since this is by default readonly
so we can't overwrite it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not tested this locally yet.
Co-authored-by: Krishna (kc) Glick <krishna@airbyte.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
}); | ||
|
||
it("should not overwrite in a non dev environment", () => { | ||
(process.env.NODE_ENV as string) = "productions"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It's probably production
without the s, but it works for the test.
What
Allows any
FeatureItem
to be overwritten in development by a env variable with the nameREACT_APP_FEATURE_{ID}
, e.g. one can have the following in the.env.development
file:To disable syncs and allow geography changes.
This is only enabled during development, since this isn't meant to be misused accidentally in environments instead of the regular feature chain (default features, workspace, users).