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 experiments and features during development #20843

Merged
merged 6 commits into from
Jan 17, 2023

Conversation

timroes
Copy link
Collaborator

@timroes timroes commented Dec 22, 2022

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 the airbyte-webapp folder, by their experiment id:

{
  "authPage.signup.hideName": true,
  "connector.orderOverwrite": { "connectorId": 5 }
}

@timroes timroes requested a review from a team as a code owner December 22, 2022 20:46
@octavia-squidington-iv octavia-squidington-iv added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Dec 22, 2022
airbyte-webapp/scripts/dev-overwrites.js Outdated Show resolved Hide resolved
airbyte-webapp/.gitignore Outdated Show resolved Hide resolved
@octavia-squidington-iv octavia-squidington-iv removed the area/platform issues related to the platform label Jan 12, 2023
npm-debug.log*
yarn-debug.log*
yarn-error.log*

*.iml
/.idea

.npmrc
Copy link
Collaborator Author

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.

@timroes timroes changed the title Allow overwriting experiments and features during development 🪟 🔧 Allow overwriting experiments and features during development Jan 12, 2023
Copy link
Contributor

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

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.

@timroes timroes merged commit f104508 into master Jan 17, 2023
@timroes timroes deleted the tim/dev-overwrites branch January 17, 2023 09:55
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants