Skip to content

Add integration test for host metadata resolution#717

Closed
hectorcast-db wants to merge 9 commits intomainfrom
hectorcast-db/stack/port-8-integration-test-metadata
Closed

Add integration test for host metadata resolution#717
hectorcast-db wants to merge 9 commits intomainfrom
hectorcast-db/stack/port-8-integration-test-metadata

Conversation

@hectorcast-db
Copy link
Contributor

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Port of Go SDK #1546. Verifies that config.resolve() populates
accountId, workspaceId, and discoveryUrl from the host's
/.well-known/databricks-config endpoint.

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
Port of Go SDK #1544. The GCP SA access token
(X-Databricks-GCP-SA-Access-Token) refresh is now non-blocking in both
GoogleIdCredentialsProvider and GoogleCredentialsCredentialsProvider.
On failure, a warning is logged and the header is skipped instead of
throwing an exception. The token is also now always attempted regardless
of client type (not just for ACCOUNT clients).

Co-authored-by: Isaac
Port of Go SDK #1546. Verifies that config.resolve() populates
accountId, workspaceId, and discoveryUrl from the host's
/.well-known/databricks-config endpoint.

Co-authored-by: Isaac
The tryResolveHostMetadata() call during config.resolve() (added in PR 4)
makes an HTTP call to /.well-known/databricks-config. This broke tests
that use FixtureServer (consumed fixtures out of order) or mock HTTP
clients (unexpected call count). Fixes:
- Catch Throwable (not just Exception) for mock assertion errors
- Add well-known fixture to ExternalBrowser tests using FixtureServer
- Filter metadata calls from captured requests in idempotency test

Co-authored-by: Isaac
@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.

@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: 717
  • Commit SHA: a90919f11954566d4c3a7ffdfcb021ef99a037e3

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db deleted the hectorcast-db/stack/port-8-integration-test-metadata 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