Skip to content

Improve auth token UX: profile selection and better empty-state handling - #4584

Merged
simonfaltum merged 4 commits into
mainfrom
simonfaltum/auth-token-profile-selection
Feb 25, 2026
Merged

Improve auth token UX: profile selection and better empty-state handling#4584
simonfaltum merged 4 commits into
mainfrom
simonfaltum/auth-token-profile-selection

Conversation

@simonfaltum

@simonfaltumsimonfaltum commented Feb 24, 2026

Copy link
Copy Markdown
Member

Summary

When databricks auth token is invoked with no arguments, resolve through env vars (DATABRICKS_HOST, DATABRICKS_CONFIG_PROFILE) first, then show an interactive profile picker or a clear non-interactive error. This is part of us moving away from a host-focused auth experience, to a profile-focused auth experience

Interactive profile picker

Search: █
Select a profile
DEFAULT (https://e2-dogfood.staging.cloud.databricks.com)
e2-demo-west (https://e2-demo-west.cloud.databricks.com)
tilefood (https://eng-ml-agent-bricks-us-east-1.staging.cloud.databricks.com/)
logfood (https://adb-2548836972759138.18.azuredatabricks.net/)
Create a new profile
Enter a host URL manually

Item ordering rationale:

  • Profiles are listed first — this is the primary use case (selecting an existing profile)
  • "Create a new profile" appears right after profiles — the natural next action when no existing profile fits
  • "Enter a host URL manually" is last — a legacy escape hatch for power users, de-prioritized in the "profile == identity" model

Search mode (>5 profiles):

  • Auto-activates search to let users find profiles quickly by name or host URL
  • Pasting a host URL from muscle memory still works — search matches against host strings
  • Typing "create" or "host" surfaces the action items

<=5 profiles: All items visible without scrolling, no search needed.

"Create a new profile" runs login inline

Selecting "Create a new profile" now runs the full auth login flow inline (prompt for profile name, prompt for host, OAuth browser challenge, save to .databrickscfg) and then returns the token — instead of printing an error telling the user to run a separate command.

Non-interactive mode

  • "no profile specified. Use --profile <name>" (profiles exist)
  • "no profiles configured. Run 'databricks auth login'" (no profiles)

Unchanged

  • Existing --profile, --host, and positional arg behavior

Test plan

  • Unit tests: 6 new test cases covering all non-interactive paths and env var resolution
  • Acceptance tests: no-args-with-profiles and no-args-no-profiles
  • All existing tests pass unchanged
  • make lintfull and make checks pass
  • Manual testing: interactive profile picker, env var resolution, existing flags
  • Manual testing: "Create a new profile" inline login flow

…dling
When `databricks auth token` is invoked with no arguments, replace the raw
host prompt with smarter resolution:
1. Check DATABRICKS_HOST env var (highest priority)
2. Check DATABRICKS_CONFIG_PROFILE env var
3. Interactive mode: show a profile selector with "Enter host manually" and
"Create new profile" options
4. Non-interactive mode: clear error messages guiding users to --profile or
databricks auth login
Existing behavior (--profile, --host, positional args) is unchanged.
Also extracts applyUnifiedHostFlags helper to reduce duplication, simplifies
test context handling, and adds acceptance tests for the non-interactive
no-args cases.
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Commit: 6000fff

Run: 22389680252

Env🟨​KNOWN🔄​flaky💚​RECOVERED🙈​SKIP✅​pass🙈​skipTime
🟨​aws linux7172687675:43
🟨​aws windows7172707655:29
💚​aws-ucws linux873646835:07
💚​aws-ucws windows873666814:03
🔄​azure linux6292657657:08
💚​azure windows292737633:52
💚​azure-ucws linux293696796:13
💚​azure-ucws windows293716774:00
💚​gcp linux292677684:34
💚​gcp windows292697664:26
21 interesting tests: 7 KNOWN, 7 SKIP, 6 flaky, 1 RECOVERED
Test Nameaws linuxaws windowsaws-ucws linuxaws-ucws windowsazure linuxazure windowsazure-ucws linuxazure-ucws windowsgcp linuxgcp windows
🟨​TestAccept🟨​K🟨​K💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
🔄​TestAccept/bundle/deployment/bind/alert🙈​s🙈​s🙈​s🙈​s🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/alert/DATABRICKS_BUNDLE_ENGINE=terraform🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/job/generate-and-bind✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/deployment/bind/job/generate-and-bind/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/destroy/jobs-and-pipeline✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🔄​TestAccept/bundle/destroy/jobs-and-pipeline/DATABRICKS_BUNDLE_ENGINE=direct✅​p✅​p✅​p✅​p🔄​f✅​p✅​p✅​p✅​p✅​p
🙈​TestAccept/bundle/resources/permissions🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions🟨​K🟨​K💚​R💚​R🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct🟨​K🟨​K💚​R💚​R
🟨​TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform🟨​K🟨​K💚​R💚​R
🙈​TestAccept/bundle/resources/postgres_branches/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/recreate🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/update_protected🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_branches/without_branch_id🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/postgres_endpoints/recreate🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
🙈​TestAccept/bundle/resources/synced_database_tables/basic🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S🙈​S
💚​TestAccept/ssh/connection💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R💚​R
Top 20 slowest tests (at least 2 minutes):
durationenvtestname
3:39gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:30aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:20aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:20aws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:18gcp windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:14gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:07gcp linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:58aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:56aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:48aws-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:45aws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:44aws-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:38azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:15azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:14azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:13azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:11azure-ucws linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:10azure-ucws windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
2:09azure windowsTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
2:04azure linuxTestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

When selecting "Create a new profile" from the interactive profile picker,
run the login flow inline instead of returning an error. Also reorder
the action items so "Create a new profile" appears before "Enter a host
URL manually" to prioritize the more common path.
@simonfaltum
simonfaltum added this pull request to the merge queueFeb 25, 2026
Merged via the queue into main with commit fe485ccFeb 25, 2026
18 checks passed
@simonfaltum
simonfaltum deleted the simonfaltum/auth-token-profile-selection branch February 25, 2026 09:54
deco-sdk-taggingBot added a commit that referenced this pull request Feb 26, 2026
## Release v0.290.0
### CLI
* Add `completion install`, `uninstall`, and `status` subcommands ([#4581](#4581))
* Wire profile name through CLI ToOAuthArgument for profile-based cache keys ([#4562](#4562))
* Add host disambiguation and positional profile support to auth token ([#4574](#4574))
* Update error messages to suggest 'databricks auth login' ([#4587](#4587))
* Resolve --host to matching profile for token cache lookup ([#4591](#4591))
* Improve auth token UX: profile selection and better empty-state handling ([#4584(#4584)
### Bundles
* Added support for git_source and git_repository for Apps ([#4538](#4538))
### Dependency updates
* Upgrade TF provider to 1.109.0 ([#4561](#4561))
* Upgrade Go SDK to v0.110.0 ([#4552](#4552))
### API Changes
* Bump databricks-sdk-go from v0.111.0 to v0.112.0.
denik pushed a commit that referenced this pull request May 20, 2026
…dling (#4584)
## Summary
When `databricks auth token` is invoked with no arguments, resolve
through env vars (`DATABRICKS_HOST`, `DATABRICKS_CONFIG_PROFILE`) first,
then show an interactive profile picker or a clear non-interactive
error. This is part of us moving away from a host-focused auth
experience, to a profile-focused auth experience
### Interactive profile picker
```
Search: █
Select a profile
DEFAULT (https://e2-dogfood.staging.cloud.databricks.com)
e2-demo-west (https://e2-demo-west.cloud.databricks.com)
tilefood (https://eng-ml-agent-bricks-us-east-1.staging.cloud.databricks.com/)
logfood (https://adb-2548836972759138.18.azuredatabricks.net/)
Create a new profile
Enter a host URL manually
```
**Item ordering rationale:**
- Profiles are listed first — this is the primary use case (selecting an
existing profile)
- "Create a new profile" appears right after profiles — the natural next
action when no existing profile fits
- "Enter a host URL manually" is last — a legacy escape hatch for power
users, de-prioritized in the "profile == identity" model
**Search mode (`>5` profiles):**
- Auto-activates search to let users find profiles quickly by name or
host URL
- Pasting a host URL from muscle memory still works — search matches
against host strings
- Typing "create" or "host" surfaces the action items
**`<=5` profiles:** All items visible without scrolling, no search
needed.
### "Create a new profile" runs login inline
Selecting "Create a new profile" now runs the full `auth login` flow
inline (prompt for profile name, prompt for host, OAuth browser
challenge, save to `.databrickscfg`) and then returns the token —
instead of printing an error telling the user to run a separate command.
### Non-interactive mode
- `"no profile specified. Use --profile <name>"` (profiles exist)
- `"no profiles configured. Run 'databricks auth login'"` (no profiles)
### Unchanged
- Existing `--profile`, `--host`, and positional arg behavior
## Test plan
- [x] Unit tests: 6 new test cases covering all non-interactive paths
and env var resolution
- [x] Acceptance tests: `no-args-with-profiles` and
`no-args-no-profiles`
- [x] All existing tests pass unchanged
- [x] `make lintfull` and `make checks` pass
- [x] Manual testing: interactive profile picker, env var resolution,
existing flags
- [x] Manual testing: "Create a new profile" inline login flow
denik pushed a commit that referenced this pull request May 20, 2026
## Release v0.290.0
### CLI
* Add `completion install`, `uninstall`, and `status` subcommands ([#4581](#4581))
* Wire profile name through CLI ToOAuthArgument for profile-based cache keys ([#4562](#4562))
* Add host disambiguation and positional profile support to auth token ([#4574](#4574))
* Update error messages to suggest 'databricks auth login' ([#4587](#4587))
* Resolve --host to matching profile for token cache lookup ([#4591](#4591))
* Improve auth token UX: profile selection and better empty-state handling ([#4584(#4584)
### Bundles
* Added support for git_source and git_repository for Apps ([#4538](#4538))
### Dependency updates
* Upgrade TF provider to 1.109.0 ([#4561](#4561))
* Upgrade Go SDK to v0.110.0 ([#4552](#4552))
### API Changes
* Bump databricks-sdk-go from v0.111.0 to v0.112.0.
Sign up for freeto 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.

3 participants

@simonfaltum@eng-dev-ecosystem-bot@shreyas-goenka