question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `--interactive --all` CLI flags in `meltano config set`

See original GitHub issue

Migrated from GitLab: https://gitlab.com/meltano/meltano/-/issues/3227

Originally created by @aaronsteers on 2022-02-09 21:01:33


Based on recent discussions around the difficulties in knowing which settings to configure when adding a new plugin, we should add an interactive mode for setting all setting for a plugin, or any specific settings value.

Something like…

> meltano config dbt-snowflake set --interactive --all

You are now configuring the "dbt-snowflake" transformer plugin.
For help, please refer to plugin documentation: https://...

We will now step through each setting. Leave any entry blank to skip, 
or enter a new value. Password values will automatically be hidden 
from display for any settings of type 'password'.

Press Ctrl+C to cancel at any time.

Setting #1: project_dir
Description: The root dbt path.
Type: string
Default value: $MELTANO_PROJECT_ROOT/transform
Current value: (none)
New Value: _ 

(skipped)

....

Setting #7: snowflake_user
Description: The username to use in Snowflake authentication.
Type: string
Default value: (none)
Current value: (none)
New Value: snowflake_prod_user

Value saved successfully to meltano.yml!

Setting #8: snowflake_password
Description: The password to use in Snowflake authentication.
Type: password
Default value: $MELTANO_PROJECT_ROOT/transform
Current value: (none)
New Value: ********** 

Value saved successfully to Meltano System DB!

Spec Details

  • Interactive behavior is triggered bia the --interactive flag in meltano config ... set.
  • Interactive behavior can be triggered for a single setting or with --all to set all settings associated with the given plugin.
  • The --all option requires the --interactive flag. If --all is specified without --interactive, Meltano should fail.
  • After each setting is set, Meltano should respond with Value saved successfully to _<store>_!
    • The store could be .env, the SystemDB, or to Meltano.yml.
    • Confirming and saving after each setting is set gives real-time feedback to the user about changes they have applied, and allows the remaining operation to be canceled without loss of any setting values already saved.
  • Individual settings should be skippable.
  • Password fields should either print asterisks or simply not echo anything while users are typing.
  • The new setting value should not be provided inline at the command line if --interactive is set. So, passing the setting value and also passing --interactive should cause Meltano to fail.

Ability to “skip” settings

Skipping a setting may not be intuitive if done inline with the setting value input.

Setting #1: project_dir
Description: The root dbt path.
Type: string
Default value: $MELTANO_PROJECT_ROOT/transform
Current value: (none)
Would you like to set a new value? [Y/n]: n

Skipped.

Setting #2: snowflake_user
Description: The username to use in Snowflake authentication.
Type: string
Default value: (none)
Current value: (none)
Would you like to set a new value? [Y/n]: Y
New Value? []: snowflake_prod_user

Value saved successfully to meltano.yml!

...

Without a separate prompt to skip or set the value, the user would generally have to type something like an empty string or s for skip, or similar. However, those are potentially valid answers to the new value prompt.

Phases

  • The initial merge should at minimum provide --all --interactive support.
  • Optionally, setting only one value (--interactive without --all) can be included in initial scope or added in a subsequent iteration.
    • When setting only a single value, presumably we do not need to allow the “skip” option described above, since the user can simply abort (ctrl+c) to cancel if they do not want the value set.
  • Not required in this first iteration, but a future iteration should require users to first define a setting’s type if the type is not yet set. Would be a path for resolving #2768. For example, if the user runs meltano config tap-snowflake set --interactive snowflake_password, that should require the user to first define the setting kind (kind is password in this case), which then drives correct parsing and storage of the provided value.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tayloramurphycommented, Aug 19, 2022

@kgpayne option 2 is a good iteration and I like AJ’s comments in https://github.com/meltano/meltano/issues/2971#issuecomment-1212326558 on having it behind a feature flag and configurable.

I can open a new issue on the possibility of a short_description key for settings. Note that the usage key is for the entire plugin and not a specific setting.


We also discussed printing a URL to the homepage/repo with a prompt along the lines of “for detailed help, see the plugins’ documentation” to compliment a shortened description.

We already print the link at least in your screenshot, so updating the text there should be good too!

0reactions
aaronsteerscommented, Aug 19, 2022

@kgpayne - Yes, I agree option 2 is great for this phase.

We want to be careful that the addition of rich doesn’t automatically change other behaviors, but once the feature flag is in place for #2971, that should be safe to add.

Also - thanks for the rendering example. I think it looks nice, and it is worthwhile having markdown-rendering-to-terminal as a tool in our toolbox overall.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command Line - Meltano Documentation
meltano add lets you add plugins to your Meltano project. ... Interactive config supports the same options as the direct set command (i.e....
Read more >
Change default behavior in `meltano config ... set` when `kind` is ...
Combining with Add `--interactive --all` CLI flags in `meltano... (#3227 - closed): If --interactive is used, we can also prompt for setting config...
Read more >
chore: add test harness for `--interactive` · Issue #6735 · meltano ...
Feature scope CLI (options, error messages, logging, etc.) Description Once #5892 merges, ... feat: add --interactive CLI flag in meltano config set #5892....
Read more >
Data Stacks For Fun & Nonprofit — Part III | by Andrew Stewart
Setting up dbt is very similar to that of Meltano. We install from pip and create a new project with the dbt CLI....
Read more >
Miso, Meltano and Setting Up Real-Time, Continuous ... - Miso.ai
Let's look at a concrete example. Suppose your product catalog lives in a Postgres database. Your merchandising and (physical) product team adds new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found