Repository navigation
auth login: cap the optional workspace lookup at 5s and explain the fallback - #7522
Merged
qianhao-zhang-databricks merged 3 commits intoNov 13, 2026
Merged
Conversation
…allback On a unified host, `databricks auth login` lists account workspaces to populate a picker. When that call returned 503 the SDK retried for its default ~5 minutes with no output before falling back to the manual workspace ID prompt. The lookup is best-effort, so bound its retry and HTTP budget to 5 seconds, print a progress line, and show why it fell back along with the non-interactive `--host "<host>?w=<workspace_id>"` form. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Collaborator
✅ Integration test reportCommit: e55d5d9
Top 6 slowest tests (at least 2 minutes):
|
rugpanov
removed their request for review
November 12, 2026 09:40
mihaimitrea-db
approved these changes
Nov 13, 2026
mihaimitrea-db
left a comment
Contributor
There was a problem hiding this comment.
Change looks good.
maksim-zuev-db
approved these changes
Nov 13, 2026
| workspaces, err := a.Workspaces.List(ctx) | ||
| if err != nil { | ||
| log.Debugf(ctx, "Failed to load workspaces (this can happen if the user has no account-level access): %v", err) | ||
| cmdio.LogString(ctx, "Could not list workspaces for this account. To skip this step, pass a host with the workspace ID, e.g. --host \"<host>?w=<workspace_id>\".") |
Member
There was a problem hiding this comment.
nit: The non-TTY branch a few lines up tells users to pass --workspace-id, and this hint suggests --host "<host>?w=<workspace_id>" for the same goal. Both work, but it'd be nice if the two messages agreed. --workspace-id is also shorter and doesn't make the user rebuild the host URL. People who only want account-level access probably want --skip-workspace instead, so it could be worth mentioning too. Something like:
cmdio.LogString(ctx, "Could not list workspaces for this account. To skip this step, pass --workspace-id <workspace_id>, or --skip-workspace for account-level access only.")
qianhao-zhang-databricks
deleted the
qianhao/auth-login-workspace-list-timeout
branch
November 13, 2026 18:04
Collaborator
❌ Integration test reportCommit: daad5b4
58 interesting tests: 46 FAIL, 11 RECOVERED, 1 KNOWN
Top 50 slowest tests (at least 2 minutes):
|
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.
Changes
databricks auth loginon a unified host now gives up on the optional workspace lookup after ~5 seconds instead of ~5 minutes, prints a progress line while it looks, and says why it fell back to the manual prompt.Workspaces.ListgetsHTTPTimeoutSecondsandRetryTimeoutSecondsof 5. Other API calls keep the SDK default retry policy.Looking up workspaces for your account...before the lookup.--host "<host>?w=<workspace_id>", then shows the existingEnter workspace IDprompt.Why
After OAuth succeeds, the CLI lists account workspaces to populate a picker. When that endpoint returns 503 the SDK retried for its default ~5 minutes with no output, which looks like a hang to people and to coding agents with tool timeouts. The lookup is best-effort and already falls back to a manual prompt, so retrying that long only adds dead time. Ticket: CNXT-2597.
Tests
TestPromptForWorkspaceSelectionGivesUpQuicklyOnUnavailable: a server that always returns 503 must lead to the manual workspace ID prompt, the progress line and the?w=hint, well under the old 5 minute budget. The test shortens the 5s budget to 1s through a test-only setter.TestPromptForWorkspaceSelectionNoResults/01-initial.golden, which now includes the progress line.go test ./cmd/auth/passes. I did not run the new test without the fix to confirm it fails first.This pull request and its description were written by Isaac.