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

🪟 🔧 Allow overwriting features in dev by env variables #20231

Merged
merged 5 commits into from
Dec 9, 2022

Conversation

timroes
Copy link
Collaborator

@timroes timroes commented Dec 8, 2022

What

Allows any FeatureItem to be overwritten in development by a env variable with the name REACT_APP_FEATURE_{ID}, e.g. one can have the following in the .env.development file:

REACT_APP_FEATURE_ALLOW_SYNC=false
REACT_APP_FEATURE_ALLOW_CHANGE_DATA_GEOGRAPHIES=true

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).

@timroes timroes added the area/frontend Related to the Airbyte webapp label Dec 8, 2022
@timroes timroes requested a review from a team as a code owner December 8, 2022 15:36
@octavia-squidington-iv octavia-squidington-iv added the area/platform issues related to the platform label Dec 8, 2022
Copy link
Contributor

@edmundito edmundito left a 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";
Copy link
Collaborator Author

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.

Copy link
Contributor

@krishnaglick krishnaglick left a 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>
Copy link
Contributor

@edmundito edmundito left a 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";
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants