Skip to content

Remove unified flag usage, rely on host metadata#715

Closed
hectorcast-db wants to merge 6 commits intomainfrom
hectorcast-db/stack/port-6-remove-unified-flag
Closed

Remove unified flag usage, rely on host metadata#715
hectorcast-db wants to merge 6 commits intomainfrom
hectorcast-db/stack/port-6-remove-unified-flag

Conversation

@hectorcast-db
Copy link
Contributor

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Port of Go SDK #1547. Removes HostType.UNIFIED and all runtime checks
of experimentalIsUnifiedHost. Host type is now determined solely from
URL pattern (accounts.* = ACCOUNTS, else WORKSPACE). Host metadata
resolution from /.well-known/databricks-config (added in PR 4) handles
populating accountId, workspaceId, and discoveryUrl automatically.

Key changes:

  • getHostType(): no longer returns UNIFIED
  • isAccountClient(): no longer throws for unified hosts
  • getClientType(): simplified, no UNIFIED case
  • fetchDefaultOidcEndpoints(): removed unified OIDC branch
  • DatabricksCliCredentialsProvider: removed --experimental-is-unified-host
  • AccountClient.getWorkspaceClient(): uses DNS zone matching (like Go SDK)
    to decide whether to reuse host or build deployment URL

Co-authored-by: Isaac

Why

What changed

Interface changes

Behavioral changes

Internal changes

How is this tested?

Port of Go SDK #1512. Adds a `cloud` field (String, `@JsonProperty("cloud")`)
to the HostMetadata class, with getter and updated constructor. Includes
deserialization and constructor tests.

Co-authored-by: Isaac
Port of Go SDK #1517. Previously getWorkspaceClient() mutated the
AccountClient's own config when setting workspaceId for unified hosts,
causing stale state on subsequent calls. Now clones the config instead.

Co-authored-by: Isaac
Port of Go SDK #1518. Verifies that getWorkspaceClient() on a unified
(SPOG) host clones the config rather than mutating the AccountClient's
config, so multiple calls produce independent WorkspaceClients.

Co-authored-by: Isaac
Port of Go SDK #1542. Calls resolveHostMetadata() during config
resolve() to populate accountId, workspaceId, and discoveryUrl from
the host's well-known endpoint. Failures are logged at debug level
and do not block initialization. Also fixes clone() to skip static
fields (needed for the new Logger field).

Co-authored-by: Isaac
Port of Go SDK #1543. When resolveHostMetadata() runs on an account
host and tokenAudience is not already set, automatically sets it to
the accountId. This enables OIDC token exchange to work correctly
for account-level operations without explicit TOKEN_AUDIENCE config.

Co-authored-by: Isaac
Port of Go SDK #1547. Removes HostType.UNIFIED and all runtime checks
of experimentalIsUnifiedHost. Host type is now determined solely from
URL pattern (accounts.* = ACCOUNTS, else WORKSPACE). Host metadata
resolution from /.well-known/databricks-config (added in PR 4) handles
populating accountId, workspaceId, and discoveryUrl automatically.

Key changes:
- getHostType(): no longer returns UNIFIED
- isAccountClient(): no longer throws for unified hosts
- getClientType(): simplified, no UNIFIED case
- fetchDefaultOidcEndpoints(): removed unified OIDC branch
- DatabricksCliCredentialsProvider: removed --experimental-is-unified-host
- AccountClient.getWorkspaceClient(): uses DNS zone matching (like Go SDK)
  to decide whether to reuse host or build deployment URL

Co-authored-by: Isaac
@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-java

Inputs:

  • PR number: 715
  • Commit SHA: 129b16710643642c5608ea795caa189ccc3a4eb6

Checks will be approved automatically on success.

@github-actions
Copy link

Please ensure that the NEXT_CHANGELOG.md file is updated with any relevant changes.
If this is not necessary for your PR, please include the following in your PR description:
NO_CHANGELOG=true
and rerun the job.

@hectorcast-db hectorcast-db deleted the hectorcast-db/stack/port-6-remove-unified-flag branch March 19, 2026 10:09
Sign up for free to 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.

1 participant