netlify / cli

Netlify Command Line Interface
http://cli.netlify.com
MIT License
1.56k stars 343 forks source link

feat: add flag to skip env var fetching #6723

Closed davbree closed 6 days ago

davbree commented 2 weeks ago

๐ŸŽ‰ 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:

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

github-actions[bot] commented 2 weeks ago

๐Ÿ“Š Benchmark results

Comparing with a265859e7e440685a8209fc153f660438d49b535

lukasholzer commented 1 week ago

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

davbree commented 1 week ago

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)

lukasholzer commented 1 week ago

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.

mraerino commented 1 week ago

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

davbree commented 1 week ago

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