Skip to content

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

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

dimk0 wants to merge 4 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.
  • The flag help says what to expect: Skip validating the profiles (the Valid column is omitted and JSON "valid" is always false).
  • JSON output is unchanged (valid stays false when validation is skipped), so the shape stays stable for tools that parse it. The render-only field carries a comment saying why it is kept out of JSON.

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".

Tests

  • New text-mode case in acceptance/cmd/auth/profiles (auth profiles --skip-validate), and the updated acceptance/cmd/auth/switch/nominal golden.
  • 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, ./task fmt-q and ./task check-changelog are clean. Tests ran with DATABRICKS_WORKSPACE_ID unset: some tests in login_test.go and token_test.go 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 <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Commit: e56d4c2e7 | Workflow run

Regression test report

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

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

main (20fef7c):

acceptance_test.go:1374: Diff:
        --- cmd/auth/profiles/output.txt
        +++ /tmp/TestAcceptcmdauthprofiles4209689254/002/output.txt
        @@ -32,7 +32,7 @@
         === 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
        +Name               Host                                     Valid
        +workspace-profile  https://workspace.cloud.databricks.test  NO
        +account-profile    https://accounts.cloud.databricks.test   NO
        +unified-profile    https://unified.databricks.test          NO

latest (v1.26.0): same output as main (20fef7c)

TestAccept/cmd/auth/switch/nominal: branch ✅ | main (20fef7c) ❌ | latest (v1.26.0) ❌

main (20fef7c):

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/TestAcceptcmdauthswitchnominal386892395/002/output.txt
FAIL

latest (v1.26.0): same output as main (20fef7c)

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: e56d4c2

Run: 43770674315

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 17 3:31
💚​ aws-windows-latest-4core-16gb 1 272 15 3:29
💚​ azure linux-2core-8gb 1 269 17 3:20
💚​ azure-windows-latest-4core-16gb 1 271 15 2:50
💚​ gcp linux-2core-8gb 1 270 17 3:30
💚​ gcp-windows-latest-4core-16gb 1 272 15 3:07
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:26 aws-windows-latest-4core-16gb TestAccept
3:03 gcp-windows-latest-4core-16gb TestAccept
2:45 azure-windows-latest-4core-16gb TestAccept

dimk0 and others added 2 commits November 15, 2026 22:09
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 <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@dimk0
dimk0 marked this pull request as ready for review November 16, 2026 03:50
@dimk0
dimk0 requested review from a team as code owners November 16, 2026 03:50
@dimk0
dimk0 requested review from Divyansh-db and pietern November 16, 2026 03:50
@pietern pietern added the auth label Nov 16, 2026
idelafuente-oc pushed a commit to idelafuente-oc/cli that referenced this pull request Nov 16, 2026
Apply the existing `auth` label, which nothing applies today.

Examples: databricks#7638, databricks#7522.

This pull request and its description were written by Isaac.

Co-authored-by: Isaac <no-reply@databricks.com>
@dimk0

dimk0 commented Nov 19, 2026

Copy link
Copy Markdown
Member Author

/review

@review-oss-bot review-oss-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review at e56d4c2. Each finding was verified against the code.

No blocking issues found.

This PR makes auth profiles --skip-validate omit the Valid column from text output instead of showing NO for every profile, while keeping JSON output unchanged. The implementation is clean: a render-only boolean on an anonymous render-only struct, guarded by json:"-", drives a conditional column in the template. Acceptance tests cover both text and JSON modes. I found no correctness issues or rule violations.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants