fermyon / cloud-plugin

A Spin plugin for the Spin CLI for managing Spin apps in Fermyon Cloud.
https://developer.fermyon.com/cloud/
Apache License 2.0
8 stars 13 forks source link

Add `--accept-defaults` flag to avoid terminal interactivity #126

Closed kate-goldenring closed 12 months ago

kate-goldenring commented 1 year ago

fixes #125

itowlson commented 1 year ago

Are there no cases at the moment where a script might want to run a command and not accept the defaults, e.g. for setting up links during deploy?

kate-goldenring commented 1 year ago

Are there no cases at the moment where a script might want to run a command and not accept the defaults, e.g. for setting up links during deploy?

@itowlson for do you mean to enable them to specify what database to link to? Would you expect something like --link label1:db1 --link label2:db2? I went with a fairly narrow scope here thinking this is a place to start to unblock removing interactivity, but if this choice makes future flexibility harder, we can definitely discuss some creative options here

itowlson commented 1 year ago

For confirmation, you mentioned that we already have --yes on database deletion. Perhaps that should be our general option for non-interactive confirmations? In this case for the "change existing link" situation. (If I read it right, the default for "change existing link" is "no", so this is not accepting the defaults.)

Although now I am imagining the case where someone wants to link a label but only if that label isn't already linked. So they'd want a --no flag. Yuck. I am not sure how to tackle this.

itowlson commented 1 year ago

@kate-goldenring Yeah that is the sort of conundrum I am wondering about - link to existing DBs vs create new, that kind of thing. I don't think the CI scenarios are so pressing that we need to "unblock" them (although I will probably turn out to be laughably wrong when half our E2E tests complain about it) - maybe we should take a bit more time on this? Sorry

kate-goldenring commented 12 months ago

closing for https://github.com/fermyon/cloud-plugin/pull/151