Add --auto-approve to experimental prompt sites#5026
Merged
simonfaltum merged 2 commits intomainfrom Apr 20, 2026
Merged
Conversation
Five confirmation prompts in experimental commands had no bypass flag, so CI and scripted invocations would either hang waiting on stdin or fail outright. - `databricks ssh setup --auto-approve` recreates an existing host config without prompting. - `databricks ssh connect --auto-approve` installs the required IDE SSH extension and applies missing IDE settings without prompting. - `databricks apps dev-remote --auto-approve` trusts every viewer connection for the life of the session. Intended for trusted environments only. - `databricks apps init --auto-approve` skips the optional-resource confirmation; optional resources are only configured when their values are supplied via --set. All affected commands are hidden/experimental, so no CHANGELOG entry is added.
- client.go: drop the outer `(cmdio.IsPromptSupported(ctx) || opts.AutoApprove)` guard; `CheckAndUpdateSettings` already owns this policy internally and returns nil with a log when neither holds, so the outer check was duplicate state that had to be kept in sync with the callee. - init.go: drop a tautological field comment and a docstring sentence that duplicated an inline comment at the only branch using the flag.
janniklasrose
approved these changes
Apr 20, 2026
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
The rest of the CLI already exposes
--auto-approveon confirmation prompts:bundle deploy,bundle destroy,pipelines deploy,pipelines destroy,completion install,completion uninstall,auth logout, andapps deleteall have it. Five prompts in experimental commands do not, which is inconsistent and also blocks any non-interactive use of those commands (CI, scripts).The five sites:
databricks ssh setup: "Host already exists" promptdatabricks ssh connect: required IDE extension installdatabricks ssh connect: IDE settings updatedatabricks apps dev-remote: viewer connection requestdatabricks apps init: optional resource confirmationAll five are in
Hidden: true/ experimental commands.Changes
Before: these prompts could not be bypassed, so these commands didn't match the
--auto-approveconvention the rest of the CLI has settled on.Now: each of the four owning commands accepts
--auto-approve, and the prompt is skipped when the flag is set.Follows the same convention as the commands listed above: a bool flag on the command, threaded through the options struct, checked before the prompt. No new cmdio helper, no context-based capability, no new pattern - just applying the existing one to the last few places that didn't have it.
Behavior details:
ssh setup --auto-approve: recreates an existing host config without prompting.ssh connect --auto-approve: installs the required IDE SSH extension and applies missing IDE settings without prompting. Also removes thecmdio.IsPromptSupportedshort-circuit on the settings path so the flag works in non-TTY contexts (the whole point).apps dev-remote --auto-approve: auto-approves every viewer connection for the life of the session. Help text flags the trust implication (anyone with the shareable dev URL is trusted). Intended for trusted environments only.apps init --auto-approve: skips theConfigure <optional resource>?confirmation. Optional resources are only configured when their values are supplied via--set plugin.resourceKey.field=value.No
NEXT_CHANGELOG.mdentry since all commands are experimental.Test plan
make checkscleanmake lintcleango test ./experimental/ssh/... ./libs/apps/vite/... ./cmd/apps/...passesTestSetup_AutoApproveRecreatesExistingHost: Setup with AutoApprove=true recreates a pre-existing host configTestCheckIDESSHExtension_AutoApproveMissing_Installs: extension is installed without a promptTestCheckIDESSHExtension_NoPrompt_WithoutAutoApprove_Errors: non-interactive without the flag still errors with install instructionsTestCheckAndUpdateSettings_AutoApproveWithoutPromptSupport: settings applied even when prompts are unsupportedTestCheckAndUpdateSettings_AutoApproveCreatesMissingFile: missing settings file is createdTestNewBridge_AutoApprove: bridge stores the flagTestBridgeHandleConnectionRequest_AutoApproveSkipsStdin: connection request is approved without reading stdindatabricks ssh setup --name h --cluster <id>twice; second run with--auto-approverecreates silentlydatabricks ssh connect --ide vscode --auto-approvewith the SSH extension missing: installs without a promptdatabricks apps dev-remote --name <app> --auto-approve: external viewer opens the shareable URL and is approved without stdin interactiondatabricks apps init --name x --features analytics --auto-approve: optional resources are skipped when no--setsupplied; honored when--setis supplied