cli icon indicating copy to clipboard operation
cli copied to clipboard

feat: add flag to skip env var fetching

Open davbree opened this issue 1 year ago โ€ข 1 comments

๐ŸŽ‰ Thanks for submitting a pull request! ๐ŸŽ‰

Summary

Introduce internal option --offline-env to disable using any env vars fetched from the API. This offers better support for the case of receiving all env vars externally (via devbot).

ref CRE-1078


For us to review and ship your PR efficiently, please perform the following steps:

  • [ ] Open a bug/issue before writing your code ๐Ÿง‘โ€๐Ÿ’ป. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire ๐Ÿ”ฅ (e.g. incident related), you can skip this step.
  • [ ] Read the contribution guidelines ๐Ÿ“–. This ensures your code follows our style guide and passes our tests.
  • [ ] Update or add tests (if any source code was changed or added) ๐Ÿงช
  • [ ] Update or add documentation (if features were changed or added) ๐Ÿ“
  • [ ] Make sure the status checks below are successful โœ…

A picture of a cute animal (not mandatory, but encouraged)

davbree avatar Jun 23 '24 06:06 davbree

๐Ÿ“Š Benchmark results

Comparing with a265859e7e440685a8209fc153f660438d49b535

  • Dependency count: 1,212 (no change)
  • Package size: 313 MB (no change)
  • Number of ts-expect-error directives: 976 (no change)

github-actions[bot] avatar Jun 23 '24 06:06 github-actions[bot]

why cannot we use the existing --offline flag for it?

lukasholzer avatar Jul 01 '24 12:07 lukasholzer

We still want to fetch the site config (for the dev command and target port). I could provide that from bitballoon as well in the future (CRE-1431) and then we can use --offline (and remove --offline-env)

davbree avatar Jul 01 '24 13:07 davbree

We still want to fetch the site config (for the dev command and target port). I could provide that from bitballoon as well in the future (CRE-1431) and then we can use --offline (and remove --offline-env)

As this is public API on the CLI we should provide that probably first to be able to leverage the --offline flag.

lukasholzer avatar Jul 01 '24 13:07 lukasholzer

i think there is value in having a flag just for "don't fetch env vars". using --offline means that no interaction can happen, but we might want the CLI to talk to services regardless of if it is supposed to fetch env vars

mraerino avatar Jul 01 '24 13:07 mraerino

I'm using hideHelp(true) to keep things internal (like we do for other parameters). Makes it easier to do this not all together..

davbree avatar Jul 01 '24 13:07 davbree