Commit cbb703c
Prompt for workspace ID when workspace list fails (#4859)
## Summary
- When `databricks auth login` fails to fetch the workspace list (e.g.
user lacks account-level permissions), prompt the user to manually enter
a workspace ID instead of logging and error and skipping the workspace
selection.
- Empty input skips workspace selection to support account only
profiles.
## Manual test
```
$ ./cli auth login --host https://db-deco-test.databricks.com/
Databricks profile name [db-deco-test]:
Profile db-deco-test was successfully saved
$ ./cli auth login --host https://dogfood.staging.databricks.com/
Databricks profile name [dogfood]:
Warn: Failed to load workspaces (this can happen if the user has no account-level access): Invalid Token
Enter workspace ID (empty to skip): 123
Profile dogfood was successfully saved
```
## Test plan
- [x] Manually tested with a host where workspace listing fails (no
account-level access)
- [x] Manually tested with a host where workspace listing succeeds (no
change in behavior)
This pull request was AI-assisted by Isaac.
---------
Co-authored-by: Renaud Hartert <renaud.hartert@databricks.com>1 parent 7314ef3 commit cbb703c
1 file changed
+15
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
| 728 | + | |
| 729 | + | |
729 | 730 | | |
730 | 731 | | |
731 | 732 | | |
| |||
764 | 765 | | |
765 | 766 | | |
766 | 767 | | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
767 | 781 | | |
768 | 782 | | |
769 | 783 | | |
| |||
0 commit comments