Commit 7748059
authored
auth: decouple CLI from SDK's Experimental_IsUnifiedHost field (#5047)
## Why
Prep for SDK bump
[databricks/databricks-sdk-go#1641](databricks/databricks-sdk-go#1641),
which removes `Experimental_IsUnifiedHost`, its env var, and the
`UnifiedHost` case in `HostType()`. After the bump the CLI wouldn't
compile.
Rather than stubbing the field and leaving the plumbing behind, this PR
fully drops the flag from the CLI surface now that
`.well-known/databricks-config` discovery is the canonical way to detect
unified hosts.
## Changes
Before: CLI wrote `Experimental_IsUnifiedHost` into every config,
exposed `--experimental-is-unified-host`, read
`experimental_is_unified_host` from `.databrickscfg` profiles, and
honored the `DATABRICKS_EXPERIMENTAL_IS_UNIFIED_HOST` env var.
Now: unified-host routing comes entirely from
`.well-known/databricks-config`. Flag, env var, and profile key read are
all gone. The only surviving mention is a deprecated no-op field on
`Workspace` so existing `databricks.yml` files validate.
Removed:
- `--experimental-is-unified-host` flag (`cmd/auth/auth.go`)
- `AuthArguments.IsUnifiedHost` and the `unifiedHostFallback` parameter
threaded through `HasUnifiedHostSignal` / `IsSPOG` / `ResolveConfigType`
- `legacyUnifiedHostFromProfile()` (`libs/auth/credentials.go`) and its
caller in `error.go`
- `profile.Profile.IsUnifiedHost` and the INI key read in
`FileProfilerImpl.LoadProfiles`
- `profileMetadata.isUnifiedHost` (`cmd/auth/profiles.go`),
`applyUnifiedHostFlags` (`cmd/auth/token.go`)
- `acceptance/auth/credentials/unified-host/` (tested the now-removed
env var; discovery-based unified-host coverage remains in
`TestToOAuthArgument_SPOGHostRoutesToUnified`,
`TestRunHostDiscovery_SPOGHost`, `TestProfileLoadSPOGConfigType`,
`TestLogoutSPOGProfile`, all using mock `.well-known` servers)
Kept:
- `Workspace.ExperimentalIsUnifiedHost` in `bundle/config/workspace.go`
as a deprecated no-op field so existing `databricks.yml` still
validates. Annotation updated.
- Clearing `experimental_is_unified_host` from profiles on OAuth login
and `configure` save, so legacy keys get cleaned up on re-login.
Shared helpers extracted while touching the code:
- `databrickscfg.ExperimentalIsUnifiedHostKey` constant for the
cleanup-only INI key (was 4 string literals)
- `auth.IsClassicAccountHost` helper replacing 3 copies of the
`accounts.` / `accounts-dod.` prefix check
Back-compat:
| Scenario | Behavior |
| --- | --- |
| Profile with `experimental_is_unified_host = true`, reachable
`.well-known/databricks-config` | Still works via discovery. INI key
silently ignored, cleared on next login. |
| Profile with `experimental_is_unified_host = true`, unreachable
`.well-known` | No longer routes as unified. User needs to re-login. |
| `--experimental-is-unified-host` flag | Removed; passing it is an
unknown-flag error. |
| `DATABRICKS_EXPERIMENTAL_IS_UNIFIED_HOST` env var | Not read (was
already being removed by the SDK). |
| New `auth login` against a unified host | Unchanged; routing from
discovery. |
| `databricks.yml` with `experimental_is_unified_host: true` | Silently
ignored, field kept for schema compat. |
## Test plan
- [x] `make checks` clean
- [x] `make lint` 0 issues
- [x] `go test ./libs/auth/... ./cmd/auth/... ./bundle/config/...
./libs/databrickscfg/... ./cmd/configure/...`
- [x] `go test ./acceptance -run
'TestAccept/(cmd/auth|auth|cmd/configure)'`
- [x] `make schema` and `make docs` regenerated; bundle tests green1 parent 22a957e commit 7748059
32 files changed
Lines changed: 628 additions & 418 deletions
File tree
- acceptance/auth/credentials/unified-host
- bundle
- config
- docsgen/output
- internal/schema
- schema
- cmd
- auth
- configure
- libs
- auth
- databrickscfg
- profile
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
Lines changed: 0 additions & 39 deletions
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| |||
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 143 | + | |
| 144 | + | |
141 | 145 | | |
142 | 146 | | |
143 | 147 | | |
| |||
0 commit comments