-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 experiments and features during development #20843
Conversation
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
*.iml | ||
/.idea | ||
|
||
.npmrc |
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.
ℹ️ Not sure why this was ignored, since it was also checked in (and should be). So I removed it from the .gitignore file.
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.
Looks good! I tested it locally overwriting a few experiment values, worked as expected 👍 This will testing experiments in OSS much easier 🙂
const EXPERIMENTS_FILE = path.resolve(__dirname, "../.experiments.json"); | ||
|
||
if (fs.existsSync(EXPERIMENTS_FILE)) { | ||
console.log("\nOverwriting experiments from .experiments.json ..."); |
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.
Just a note: these console.log
calls get cleared by CRA in the console very quickly, so not super useful. With vite we could disable the clearScreen
option to keep this debug info in the console.
What
This allows easily overwriting the state of experiments or features during development with a custom value. Those overwrites work whether the app is run in OSS or in Cloud mode.
Those overwrite files are ignored in git so they can't accidentally be commited. Also the overwrites will only work during development, so they can't be missued in production systems.
Documentation about that feature will be added to Notion after merging.
Experiments
You can overwrite the state of experiments (
useExperiment
) via a file called.experiments.json
in theairbyte-webapp
folder, by their experiment id: