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

SNOW-1471194: Adding an option --use-defaults with add connection #1178

Open
kameshsampath opened this issue Jun 10, 2024 · 3 comments
Open
Labels
enhancement New feature or request

Comments

@kameshsampath
Copy link

Description

As a developer using snow cli, I would like to have an option like --use-defaults that will allow or make snow connection add use defaults for optional parameters, given the mandatory ones are passed through CLI

e.g.

snow connection add --connection-name cheatsheets --account account-id --user user --password 'password' 

IIUC these are the only mandatory parameters for a connection, when I provide them the connnection add will prompt for the other optional parameters, in those cases I wish the developer can override the prompts like with an option like --use-defaults which will just create or add connection configuration with only options passed by user.

e.g.

snow connection add --connection-name cheatsheets --account account-id --user user --password 'password'   --use-defaults

Context

When adding new connections using snow connection add

@github-actions github-actions bot changed the title Adding an option --use-defaults with add connection SNOW-1471194: Adding an option --use-defaults with add connection Jun 10, 2024
@sfc-gh-pczajka sfc-gh-pczajka added the enhancement New feature or request label Jun 10, 2024
@sfc-gh-turbaszek
Copy link
Collaborator

Set of required input depends on authorization method. That said I think we can alter the logic to:

  1. Do not prompt for additional values if one provides:
    2. --user --account --password
    3. --user --account --authenticator
  2. Prompt for missing input in any other case

WDYT @kameshsampath @sfc-gh-pczajka ?

@kameshsampath
Copy link
Author

yeah we should prompt for mandatory ones for rest we can leave to defaults when the user says --use-defaults, if user does not specify --use-defaults then we resort to existing flow of prompting. how does sound?

@sfc-gh-turbaszek
Copy link
Collaborator

I'm not convinced if we need --use-defaults. The usages can be imho split into two:

  1. Flag-driven, when user provides input via flag, in this case we we only prompt if configuration is incomplete. We assume user using flags is aware of other possible configuration options.
  2. Interactive when user adds connection in a "wizard" mode where we prompt for everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants