Skip to content

auth: hide the Valid column in auth profiles --skip-validate - #7638

Draft
dimk0 wants to merge 2 commits into
mainfrom
cnxt-2642-auth-profiles-skip-validate
Draft

dimk0 wants to merge 2 commits into
mainfrom
cnxt-2642-auth-profiles-skip-validate

Conversation

@dimk0

@dimk0 dimk0 commented Nov 14, 2026

Copy link
Copy Markdown
Member

Changes

  • With --skip-validate, the auth profiles text table omits the Valid column instead of printing NO for every profile. Without the flag, output is unchanged.
  • JSON output is unchanged (valid stays false when validation is skipped), so the shape stays stable for tools that parse it.

Why

--skip-validate never validates, so every profile showed NO, including valid profiles in active use. The databricks-ai-runtime agent skill starts sessions with exactly databricks auth profiles --skip-validate to choose a profile, and agents read NO as "log in again". Internal ticket: CNXT-2642.

Tests

  • Updated acceptance/cmd/auth/switch/nominal, the only golden with --skip-validate text output.
  • Goldens that render the Valid column (login/nominal, login/discovery, logout/stale-account-id-workspace-host, ...) and the JSON goldens pass unchanged.
  • go test ./cmd/auth/... and go test ./acceptance -run 'TestAccept/cmd/auth/' pass; ./task lint-q is clean. Tests ran with DATABRICKS_WORKSPACE_ID unset: some login_test.go tests also fail on main when that variable is set.

This pull request and its description were written by Isaac.

dimk0 and others added 2 commits November 14, 2026 23:42
--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 <[email protected]>
Co-authored-by: Isaac <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Commit: bf2cd8620 | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (2699068) latest (v1.26.0)
TestAccept/cmd/auth/switch/nominal ✅ ❌ ❌
TestAccept/cmd/auth/switch/nominal: branch ✅ | main (2699068) ❌ | latest (v1.26.0) ❌

main (2699068):

acceptance_test.go:1374: 
        	Error Trace:	/home/runner/work/cli/cli/libs/testdiff/testdiff.go:22
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1374
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:1115
        	            				/home/runner/work/cli/cli/acceptance/acceptance_test.go:660
        	Error:      	Not equal: 
        	            	expected: "\n=== Switch to profile-a\n\n>>> [CLI] auth switch --profile profile-a\nDefault profile set to \"profile-a\".\n\n=== Settings after first switch\n[__settings__]\ndefault_profile = profile-a\n\n=== Profiles after first switch\n\n>>> [CLI] auth profiles --skip-validate\nName                 Host\nprofile-a (Default)  [DATABRICKS_URL]\nprofile-b            [DATABRICKS_URL]\n\n=== Switch to profile-b\n\n>>> [CLI] auth switch --profile profile-b\nDefault profile set to \"profile-b\".\n\n=== Settings after second switch\n[__settings__]\ndefault_profile = profile-b\n\n=== Profiles after second switch\n\n>>> [CLI] auth profiles --skip-validate\nName                 Host\nprofile-a            [DATABRICKS_URL]\nprofile-b (Default)  [DATABRICKS_URL]\n"
        	            	actual  : "\n=== Switch to profile-a\n\n>>> [CLI] auth switch --profile profile-a\nDefault profile set to \"profile-a\".\n\n=== Settings after first switch\n[__settings__]\ndefault_profile = profile-a\n\n=== Profiles after first switch\n\n>>> [CLI] auth profiles --skip-validate\nName                 Host                    Valid\nprofile-a (Default)  [DATABRICKS_URL]  NO\nprofile-b            [DATABRICKS_URL]  NO\n\n=== Switch to profile-b\n\n>>> [CLI] auth switch --profile profile-b\nDefault profile set to \"profile-b\".\n\n=== Settings after second switch\n[__settings__]\ndefault_profile = profile-b\n\n=== Profiles after second switch\n\n>>> [CLI] auth profiles --skip-validate\nName                 Host                    Valid\nprofile-a            [DATABRICKS_URL]  NO\nprofile-b (Default)  [DATABRICKS_URL]  NO\n"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -13,5 +13,5 @@
        	            	 >>> [CLI] auth profiles --skip-validate
        	            	-Name                 Host
        	            	-profile-a (Default)  [DATABRICKS_URL]
        	            	-profile-b            [DATABRICKS_URL]
        	            	+Name                 Host                    Valid
        	            	+profile-a (Default)  [DATABRICKS_URL]  NO
        	            	+profile-b            [DATABRICKS_URL]  NO
        	            	 
        	            	@@ -29,5 +29,5 @@
        	            	 >>> [CLI] auth profiles --skip-validate
        	            	-Name                 Host
        	            	-profile-a            [DATABRICKS_URL]
        	            	-profile-b (Default)  [DATABRICKS_URL]
        	            	+Name                 Host                    Valid
        	            	+profile-a            [DATABRICKS_URL]  NO
        	            	+profile-b (Default)  [DATABRICKS_URL]  NO
        	            	 
        	Test:       	TestAccept/cmd/auth/switch/nominal
        	Messages:   	cmd/auth/switch/nominal/output.txt vs /tmp/TestAcceptcmdauthswitchnominal2549678845/002/output.txt
FAIL

latest (v1.26.0): same output as main (2699068)

@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: bf2cd86

Run: 43654823535

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 16 3:34
💚​ aws-windows-latest-4core-16gb 1 272 14 3:30
💚​ azure linux-2core-8gb 1 269 16 3:28
💚​ azure-windows-latest-4core-16gb 1 271 14 4:02
💚​ gcp linux-2core-8gb 1 270 16 3:26
💚​ gcp-windows-latest-4core-16gb 1 272 14 3:27
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:57 azure-windows-latest-4core-16gb TestAccept
3:26 aws-windows-latest-4core-16gb TestAccept
3:21 gcp-windows-latest-4core-16gb TestAccept

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants