From f08f60fe99d05e659b5cd4036c751e9ba53129b2 Mon Sep 17 00:00:00 2001 From: dimk0 <4886215+dimk0@users.noreply.github.com> Date: Sat, 14 Nov 2026 23:42:17 +0000 Subject: [PATCH 1/4] auth: hide the Valid column in `auth profiles --skip-validate` --skip-validate never validates, so every profile showed NO in the Valid column, including valid ones in active use. Agents choose a profile from this output and read NO as "log in again". JSON output is unchanged. Co-authored-by: Isaac --- acceptance/cmd/auth/switch/nominal/output.txt | 12 ++++++------ cmd/auth/profiles.go | 11 +++++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/acceptance/cmd/auth/switch/nominal/output.txt b/acceptance/cmd/auth/switch/nominal/output.txt index 00f83abfaa5..d1e15395009 100644 --- a/acceptance/cmd/auth/switch/nominal/output.txt +++ b/acceptance/cmd/auth/switch/nominal/output.txt @@ -11,9 +11,9 @@ default_profile = profile-a === Profiles after first switch >>> [CLI] auth profiles --skip-validate -Name Host Valid -profile-a (Default) [DATABRICKS_URL] NO -profile-b [DATABRICKS_URL] NO +Name Host +profile-a (Default) [DATABRICKS_URL] +profile-b [DATABRICKS_URL] === Switch to profile-b @@ -27,6 +27,6 @@ default_profile = profile-b === Profiles after second switch >>> [CLI] auth profiles --skip-validate -Name Host Valid -profile-a [DATABRICKS_URL] NO -profile-b (Default) [DATABRICKS_URL] NO +Name Host +profile-a [DATABRICKS_URL] +profile-b (Default) [DATABRICKS_URL] diff --git a/cmd/auth/profiles.go b/cmd/auth/profiles.go index e65b11371b7..a614fa55343 100644 --- a/cmd/auth/profiles.go +++ b/cmd/auth/profiles.go @@ -128,9 +128,11 @@ func newProfilesCommand() *cobra.Command { Use: "profiles", Short: "Lists profiles from ~/.databrickscfg", Annotations: map[string]string{ + // With --skip-validate nothing is validated, so the Valid column is + // omitted instead of reporting NO for every profile. "template": cmdio.Heredoc(` - {{header "Name"}} {{header "Host"}} {{header "Valid"}} - {{range .Profiles}}{{.Name | green}}{{if .Default}} (Default){{end}} {{.Host|cyan}} {{bool .Valid}} + {{header "Name"}} {{header "Host"}}{{if not .SkipValidate}} {{header "Valid"}}{{end}} + {{range .Profiles}}{{.Name | green}}{{if .Default}} (Default){{end}} {{.Host|cyan}}{{if not $.SkipValidate}} {{bool .Valid}}{{end}} {{end}}`), }, } @@ -175,8 +177,9 @@ func newProfilesCommand() *cobra.Command { } wg.Wait() return cmdio.Render(cmd.Context(), struct { - Profiles []*profileMetadata `json:"profiles"` - }{profiles}) + Profiles []*profileMetadata `json:"profiles"` + SkipValidate bool `json:"-"` + }{profiles, skipValidate}) } return cmd From bf2cd8620b39a96edc1c8243d22b4dc9f5da581d Mon Sep 17 00:00:00 2001 From: dimk0 <4886215+dimk0@users.noreply.github.com> Date: Sat, 14 Nov 2026 23:43:32 +0000 Subject: [PATCH 2/4] Add changelog entry Co-authored-by: Isaac --- .nextchanges/cli/7638.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nextchanges/cli/7638.md diff --git a/.nextchanges/cli/7638.md b/.nextchanges/cli/7638.md new file mode 100644 index 00000000000..c37514671dc --- /dev/null +++ b/.nextchanges/cli/7638.md @@ -0,0 +1 @@ +* `databricks auth profiles --skip-validate` omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](https://github.com/databricks/cli/pull/7638)) From 365e3f13c2bdf741e73351b2ab3c524664abc1e9 Mon Sep 17 00:00:00 2001 From: dimk0 <4886215+dimk0@users.noreply.github.com> Date: Sun, 15 Nov 2026 22:09:18 +0000 Subject: [PATCH 3/4] auth: explain skip-validate output in code, help and tests Comment why SkipValidate stays out of JSON, and state the skip-validate output in the flag help. Add a text-mode `auth profiles --skip-validate` case to the command's own acceptance test. Reword the changelog entry to say the command now omits the `Valid` column. Co-authored-by: Isaac --- .nextchanges/cli/7638.md | 2 +- acceptance/cmd/auth/profiles/output.txt | 8 ++++++++ acceptance/cmd/auth/profiles/script | 3 +++ cmd/auth/profiles.go | 7 ++++--- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.nextchanges/cli/7638.md b/.nextchanges/cli/7638.md index c37514671dc..f22a5dce736 100644 --- a/.nextchanges/cli/7638.md +++ b/.nextchanges/cli/7638.md @@ -1 +1 @@ -* `databricks auth profiles --skip-validate` omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](https://github.com/databricks/cli/pull/7638)) +* `databricks auth profiles --skip-validate` now omits the `Valid` column instead of reporting `NO` for every profile. ([#7638](https://github.com/databricks/cli/pull/7638)) diff --git a/acceptance/cmd/auth/profiles/output.txt b/acceptance/cmd/auth/profiles/output.txt index df472a2fd5e..7287b6cacc0 100644 --- a/acceptance/cmd/auth/profiles/output.txt +++ b/acceptance/cmd/auth/profiles/output.txt @@ -28,3 +28,11 @@ } ] } + +=== Profiles with workspace_id (text output) + +>>> [CLI] auth profiles --skip-validate +Name Host +workspace-profile https://workspace.cloud.databricks.test +account-profile https://accounts.cloud.databricks.test +unified-profile https://unified.databricks.test diff --git a/acceptance/cmd/auth/profiles/script b/acceptance/cmd/auth/profiles/script index 61ba384c9fb..779c006d5f9 100644 --- a/acceptance/cmd/auth/profiles/script +++ b/acceptance/cmd/auth/profiles/script @@ -3,3 +3,6 @@ sethome "./home" # home/.databrickscfg is a checked-in input with profiles including one with workspace_id. title "Profiles with workspace_id (JSON output)" $CLI auth profiles --skip-validate --output json + +title "Profiles with workspace_id (text output)" +trace $CLI auth profiles --skip-validate diff --git a/cmd/auth/profiles.go b/cmd/auth/profiles.go index a614fa55343..2d547aff567 100644 --- a/cmd/auth/profiles.go +++ b/cmd/auth/profiles.go @@ -138,7 +138,7 @@ func newProfilesCommand() *cobra.Command { } var skipValidate bool - cmd.Flags().BoolVar(&skipValidate, "skip-validate", false, "Whether to skip validating the profiles") + cmd.Flags().BoolVar(&skipValidate, "skip-validate", false, "Skip validating the profiles (the Valid column is omitted and JSON valid is always false)") cmd.RunE = func(cmd *cobra.Command, args []string) error { var profiles []*profileMetadata @@ -177,8 +177,9 @@ func newProfilesCommand() *cobra.Command { } wg.Wait() return cmdio.Render(cmd.Context(), struct { - Profiles []*profileMetadata `json:"profiles"` - SkipValidate bool `json:"-"` + Profiles []*profileMetadata `json:"profiles"` + // Used only by the text template; kept out of JSON so its shape stays stable. + SkipValidate bool `json:"-"` }{profiles, skipValidate}) } From e56d4c2e75be9d3d0560847cb3616a140d76b94a Mon Sep 17 00:00:00 2001 From: dimk0 <4886215+dimk0@users.noreply.github.com> Date: Sun, 15 Nov 2026 22:39:32 +0000 Subject: [PATCH 4/4] auth: quote the JSON field name in the skip-validate help Co-authored-by: Isaac --- cmd/auth/profiles.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/auth/profiles.go b/cmd/auth/profiles.go index 2d547aff567..56998266a76 100644 --- a/cmd/auth/profiles.go +++ b/cmd/auth/profiles.go @@ -138,7 +138,7 @@ func newProfilesCommand() *cobra.Command { } var skipValidate bool - cmd.Flags().BoolVar(&skipValidate, "skip-validate", false, "Skip validating the profiles (the Valid column is omitted and JSON valid is always false)") + cmd.Flags().BoolVar(&skipValidate, "skip-validate", false, "Skip validating the profiles (the Valid column is omitted and JSON \"valid\" is always false)") cmd.RunE = func(cmd *cobra.Command, args []string) error { var profiles []*profileMetadata