Skip to content

[Internal] Add HostType to HostMetadata#747

Draft
tanmay-db wants to merge 8 commits intomainfrom
hosttype-metadata
Draft

[Internal] Add HostType to HostMetadata#747
tanmay-db wants to merge 8 commits intomainfrom
hosttype-metadata

Conversation

@tanmay-db
Copy link
Copy Markdown
Contributor

@tanmay-db tanmay-db commented Mar 30, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Changes

Adds host_type support to host metadata resolution:

  • Adds UNIFIED value to the HostType enum for unified hosts that support both workspace and account operations
  • Adds HostType.fromApiValue() to parse host type strings ("workspace", "account", "unified") from the /.well-known/databricks-config discovery
    endpoint
  • Adds host_type field to HostMetadata model
  • Adds resolvedHostType field to DatabricksConfig, populated during resolveHostMetadata() when host_type is present in the response
  • Makes AccountClientTest hermetic using FixtureServer instead of real hostnames

Tests

  • HostTypeTest: unit tests for fromApiValue() — workspace, account, unified, null, empty, unknown
  • DatabricksConfigTest: integration tests for resolveHostMetadata() populating resolvedHostType for all host types, verifying it doesn't overwrite if
    already set
  • AccountClientTest: updated to use FixtureServer for hermetic testing

Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
@tanmay-db tanmay-db temporarily deployed to test-trigger-is March 30, 2026 15:09 — with GitHub Actions Inactive
@tanmay-db tanmay-db temporarily deployed to test-trigger-is March 30, 2026 15:09 — with GitHub Actions Inactive
@tanmay-db tanmay-db changed the title Add HostType to HostMetadata [Internal] Add HostType to HostMetadata Mar 30, 2026
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
Signed-off-by: Tanmay Rustagi <tanmay.rustagi@databricks.com>
# Conflicts:
#	databricks-sdk-java/src/main/java/com/databricks/sdk/core/HostType.java
resolve() internally calls tryResolveHostMetadata() which consumes
a fixture from the FixtureServer. Tests that then explicitly call
resolveHostMetadata() need a second fixture registered to avoid
server returning an unexpected response.
resolve() internally calls tryResolveHostMetadata() which already
populates resolvedHostType. Remove the redundant explicit calls
and revert to single fixtures, except for
testResolveHostMetadataDoesNotOverwriteExistingHostType which
genuinely needs a second call to verify no-overwrite behavior.
…with FixtureServer

Replace real unified.databricks.com hostname with FixtureServer to prevent
host metadata resolution from hitting live servers during tests.

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

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: 747
  • Commit SHA: bbe3c5823725379fa8dd8c9a96e60c8d05332d81

Checks will be approved automatically on success.

@tanmay-db tanmay-db deployed to test-trigger-is April 11, 2026 12:13 — with GitHub Actions Active
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