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
Implement Experiments feature #4994
Conversation
@@ -281,7 +281,7 @@ export async function resolveBackend( | |||
nonInteractive?: boolean | |||
): Promise<{ backend: backend.Backend; envs: Record<string, params.ParamValue> }> { | |||
let paramValues: Record<string, params.ParamValue> = {}; | |||
if (previews.functionsparams) { | |||
if (experiments.isEnabled("functionsparams")) { |
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.
@Berlioz Does this still need to be hidden behind an experiment or do we think we are stable enough to roll forward? (If not, can we leave a comment on when this should be rolled forward?)
@@ -272,7 +272,7 @@ export async function prepare( | |||
* This must be called after `await validate.secretsAreValid`. | |||
*/ | |||
updateEndpointTargetedStatus(wantBackends, context.filters || []); | |||
if (previews.skipdeployingnoopfunctions) { | |||
if (experiments.isEnabled("skipdeployingnoopfunctions")) { |
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.
@TheIronDev When does this experiment go away?
A note to all people tagged for review on your experiment. If your experiment is going to have external users, you should add a log whenever executing experimental codepaths that mentions "experimental" in bold. E.g. "Deploying functions with experimental support for Python" or "Deploying hosting with experimental support for web frameworks" |
Codecov ReportBase: 55.88% // Head: 55.89% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #4994 +/- ##
=======================================
Coverage 55.88% 55.89%
=======================================
Files 305 305
Lines 20325 20351 +26
Branches 4094 4100 +6
=======================================
+ Hits 11359 11375 +16
- Misses 8011 8021 +10
Partials 955 955
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
ping? |
src/commands/experiments-clear.ts
Outdated
logger.error(`Did you mean ${potentials[0]}?`); | ||
} else if (potentials.length) { | ||
logger.error( | ||
`Did you mean ${potentials.slice(0, -1).join(",")} or ${potentials[potentials.length - 1]}?` |
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.
optionally:
`Did you mean ${potentials.slice(0, -1).join(",")} or ${potentials[potentials.length - 1]}?` | |
`Did you mean ${potentials.slice(0, -1).join(",")} or ${utils.last(potentials)}?` |
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.
Sure, but I also changed the signature of last to never return undefined since that only happened when someone passed a non-array which should never happen due to the signature of the method.
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.
I'm an idiot and last can return undefined if the array is non-empty. Will fix
src/commands/experiments-clear.ts
Outdated
experiments.setEnabled(experiment, null); | ||
experiments.flushToDisk(); | ||
logger.info(`Cleared preferences for experiment ${bold(experiment)}`); | ||
return; |
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.
Should this throw instead?
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.
Actually, Michael asked us to remove this feature for now.
src/commands/experiments-describe.ts
Outdated
} else if (potentials.length) { | ||
logger.error(`Did you mean ${potentials.slice(0, -1).join(",")} or ${last(potentials)}?`); | ||
} | ||
return; |
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.
Should this throw instead?
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.
Done
} | ||
table.push(["n", name, exp.shortDescription]); | ||
} | ||
logger.info(table.toString()); |
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.
One detail that can be punted on until later: for --json
(machine readable) output, we could export the table as a JSON-ish object (just return an object in this method). Would that be easy enough to do?
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.
I couldn't get this to work. You'll have to teach me how --json works with the commands library
Add experiments to the Firebase CLI. New commands: ``` firebase experiments:enable <experiment> firebase experiments:disable <experiment> firebase experiments:describe <experiment> firebase experiments:list ```
This is a WIP. I still need to add the experiments command (which, ironically, until API council approves will be hidden behind a preview/experiment).
TODO: Add experiments:enable/disable/list/describe/clear commands (follow-up PR?)
TODO: Get representatives of each experiment to provide a shortDescription, verify if any should be public, and verify any assertEnabled calls.