Skip to content

Add integration test for host metadata resolution#1332

Merged
hectorcast-db merged 2 commits intomainfrom
hectorcast-db/stack/fix-stub-host-metadata
Mar 13, 2026
Merged

Add integration test for host metadata resolution#1332
hectorcast-db merged 2 commits intomainfrom
hectorcast-db/stack/fix-stub-host-metadata

Conversation

@hectorcast-db
Copy link
Copy Markdown
Contributor

@hectorcast-db hectorcast-db commented Mar 13, 2026

🥞 Stacked PR

Use this link to review incremental changes.


Summary

  • Adds test_workspace_config_resolves_account_and_workspace_id integration test
  • Verifies that Config with experimental_is_unified_host=True resolves account_id and workspace_id from the host metadata endpoint
  • Overrides the root stub_host_metadata autouse fixture in integration conftest so integration tests hit real endpoints

Test plan

  • Unit tests pass (173 passed) — still use the stub
  • Integration test verifies real host metadata resolution

NO_CHANGELOG=true

@hectorcast-db hectorcast-db changed the title Add integration test for host metadata resolution of account_id and workspace_id Add integration test for host metadata resolution Mar 13, 2026
…orkspace_id

Verifies that Config with experimental_is_unified_host resolves
account_id and workspace_id from the host metadata endpoint.

Co-authored-by: Isaac
@hectorcast-db hectorcast-db force-pushed the hectorcast-db/stack/fix-stub-host-metadata branch from a8763de to f41b9ea Compare March 13, 2026 11:38
Copy link
Copy Markdown
Contributor

@tejaskochar-db tejaskochar-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

The host metadata oidc_endpoint is the OIDC root, not the full
discovery URL. Append the well-known path when constructing
discovery_url, and strip trailing slashes to avoid double slashes.

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

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-py

Inputs:

  • PR number: 1332
  • Commit SHA: abd09c542db6e7fb562460cd4e8227a441f94e7c

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db enabled auto-merge March 13, 2026 14:28
@hectorcast-db hectorcast-db added this pull request to the merge queue Mar 13, 2026
Merged via the queue into main with commit 05eab32 Mar 13, 2026
17 checks passed
@hectorcast-db hectorcast-db deleted the hectorcast-db/stack/fix-stub-host-metadata branch March 13, 2026 14:41
github-merge-queue bot pushed a commit to databricks/databricks-sdk-go that referenced this pull request Mar 16, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/databricks-sdk-go/pull/1542/files)
to review incremental changes.
-
[**stack/port/resolve-host-metadata-on-init**](#1542)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1542/files)]
-
[stack/port/resolve-token-audience-from-metadata](#1543)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1543/files/20b6cd4abc1a3284d586c88f802c4b7df2678062..9893d9cbbfe8baab7f7aeacb8ce7faf49026c86a)]
-
[stack/port/gcp-sa-token-non-blocking](#1544)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1544/files/9893d9cbbfe8baab7f7aeacb8ce7faf49026c86a..07e28b7aef05ada2f357f87faa749c6990be8173)]
-
[stack/port/test-environment-type](#1545)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1545/files/07e28b7aef05ada2f357f87faa749c6990be8173..0da1b0d546ab8842dffbd50aa55fb136bbeffddf)]
-
[stack/port/host-metadata-integration-test](#1546)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1546/files/0da1b0d546ab8842dffbd50aa55fb136bbeffddf..e9854aad19dc522ffe8def175bef3a3eabface2b)]
-
[stack/port/remove-unified-flag](#1547)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1547/files/e9854aad19dc522ffe8def175bef3a3eabface2b..fae626deb92c4671a0c8aa0f1e3e6bad1f8c5cc6)]
-
[stack/port/gcp-sa-from-metadata](#1548)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1548/files/fae626deb92c4671a0c8aa0f1e3e6bad1f8c5cc6..ecb1dbeed4ed1990a74895c6ced958c05f16ffef)]

---------
## Summary
- Port of Python SDK PR
databricks/databricks-sdk-py#1318 and discovery
URL fix from PR
databricks/databricks-sdk-py#1332
- Extract `applyHostMetadata()` from `resolveHostMetadata()` for reuse
during config init
- Call host metadata resolution during `EnsureResolved()` for unified
hosts (gated behind `Experimental_IsUnifiedHost`), with non-fatal error
handling (warns on failure)
- OIDC endpoint from metadata is now treated as the OIDC root, with
`/.well-known/oauth-authorization-server` appended to form the full
discovery URL

## Test plan
- `TestEnsureResolved_ResolvesHostMetadata_WhenUnifiedHost` — verifies
fields populated from metadata
- `TestEnsureResolved_HostMetadataFailure_NonFatal` — 500 response,
config still resolves
- `TestEnsureResolved_HostMetadata_NoOidcEndpoint_NonFatal` — missing
oidc_endpoint, no error
-
`TestEnsureResolved_HostMetadata_MissingAccountIdWithPlaceholder_Warns`
— template needs account_id but missing
- Existing `resolveHostMetadata` tests updated for new discovery URL
format

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.
github-merge-queue bot pushed a commit to databricks/databricks-sdk-go that referenced this pull request Mar 18, 2026
## 🥞 Stacked PR
Use this
[link](https://github.com/databricks/databricks-sdk-go/pull/1546/files)
to review incremental changes.
-
[**stack/port/host-metadata-integration-test**](#1546)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1546/files)]
-
[stack/port/remove-unified-flag](#1547)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1547/files/e715791f64e4510f1646cdfe8987b940d68e16a7..51c58114402bcbff9ec1038f50134dc052c89020)]
-
[stack/port/gcp-sa-from-metadata](#1548)
[[Files
changed](https://github.com/databricks/databricks-sdk-go/pull/1548/files/51c58114402bcbff9ec1038f50134dc052c89020..9fc7a606d80f252123f07bed759c3dbb4e5fd864)]

---------
## Summary
- Port of Python SDK PR
databricks/databricks-sdk-py#1332 (integration
test only)
- Add integration test verifying that `EnsureResolved` populates
`account_id` and `workspace_id` from the host metadata endpoint on
workspace environments

## Test plan
- `TestHostMetadataResolution` — requires workspace cloud env with
`CLOUD_ENV` set

NO_CHANGELOG=true

This pull request was AI-assisted by Isaac.
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.

2 participants