Add global --quiet, --no-input, and --yes flags#4726
Open
simonfaltum wants to merge 9 commits intomainfrom
Open
Add global --quiet, --no-input, and --yes flags#4726simonfaltum wants to merge 9 commits intomainfrom
simonfaltum wants to merge 9 commits intomainfrom
Conversation
Add three new global flags to control CLI interaction behavior in CI/CD pipelines and scripts: - --quiet/-q (DATABRICKS_QUIET): suppresses non-essential output (spinners, LogString/Log calls, non-error diagnostics) - --no-input (DATABRICKS_NO_INPUT): disables all interactive prompts, returning ErrNoInput or default values where available - --yes/-y (DATABRICKS_YES): auto-approves yes/no confirmation prompts Precedence for AskYesOrNo: --yes > --no-input > normal prompting. Non-interactive guards in deploy, destroy, and completion install are updated to also accept --yes as an alternative to --auto-approve. Co-authored-by: Isaac
Collaborator
|
Commit: 2989950
39 interesting tests: 11 MISS, 10 flaky, 7 SKIP, 6 RECOVERED, 3 FAIL, 1 KNOWN, 1 PANIC
Top 50 slowest tests (at least 2 minutes):
|
…, test cleanup Co-authored-by: Isaac
Add --no-input, --quiet, and --yes to all help output golden files. Update error messages to mention --auto-approve or --yes. Co-authored-by: Isaac
Contributor
shreyas-goenka
left a comment
There was a problem hiding this comment.
Note: This review was posted by Claude (AI assistant). Shreyas will do a separate, more thorough review pass.
Priority: LOW-MEDIUM — Strong implementation with minor issues
LOW: Description casing inconsistency
Flag descriptions use inconsistent casing (some start with uppercase, others lowercase). Minor but worth standardizing.
LOW: tools/gofumpt artifact
There appears to be a formatting change from tools/gofumpt mixed into this PR. Consider separating formatting-only changes.
What looks good
- Clean implementation of
--quiet,--no-input, and--yesflags - Good integration with existing
cmdiocapabilities system - Proper propagation through the command tree
- Well-structured capability checks
- Correct interaction between the three flags
Overall a solid PR. The issues are minor.
Use env.GetBool for the global interaction flags and derive new cmdio contexts when quiet, no-input, or yes is enabled so commands do not mutate shared I/O state.
…ands Fix four issues with the global interaction flags: 1. configure: check IsNoInput alongside IsPromptSupported so --no-input correctly routes to the non-interactive path. 2. auth prompts: add IsNoInput checks to promptForHost, promptForAccountID, and promptForWorkspaceID so --no-input prevents raw promptui prompts. 3. logout: allow --yes to bypass the prompt-supported guard so AskYesOrNo can auto-approve in non-interactive environments. 4. apps import: remove local --quiet flag that shadowed the root persistent --quiet, and read from cmdio.IsQuiet(ctx) instead. Also revert the unrelated tools/gofumpt addition to .gitignore.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CLI users in CI/CD pipelines and scripts need control over the CLI's interactive behavior. Currently there's no way to suppress progress output, prevent prompts from blocking automation, or auto-approve confirmations without per-command flags.
Changes
Before: No global flags for controlling output verbosity, interactivity, or confirmations. Scripts had to work around interactive prompts.
Now: Three new global flags on the root command, stored in the cmdio Capabilities struct alongside existing TTY detection:
--quiet/-q(env:DATABRICKS_QUIET): Suppresses non-essential output. Spinners become no-ops,LogString/Logcalls are silenced, and only Error-severity diagnostics render. Data output (stdout) is never affected.--no-input(env:DATABRICKS_NO_INPUT): Disables all interactive prompts. Prompt functions returnErrNoInput(or the default value if one exists).--yes/-y(env:DATABRICKS_YES): Auto-approves all yes/no confirmation prompts. Precedence: --yes (approve) > --no-input (error) > normal prompting. Non-interactive guards in deploy/destroy/completion/bind are updated to also check --yes.apps importalready had its own local-q/--quietflag that suppresses informational messages during import. The two flags are bridged: passing the global--quietalso sets the local quiet behavior in apps import, and passing the local-qon apps import also activates the global cmdio quiet mode (suppressing spinners, etc.). Both flags continue to work as before.Open items
quiet,no_input,yesshould be added to a global reject list for top-level field names in auto-generated API commands, so future API parameters don't collide with these global flags. This needs a change in the codegen pipeline (or universe API linters), tracked separately.cmdio(LogString, Log, Render, spinners). A follow-up could add a lint rule or test verifying no directfmt.Fprintf(os.Stderr, ...)calls bypass cmdio, so--quietis truly global.Test plan
make lintfullpassesmake checkspasses