Skip to content

Fix GetWorkspaceClient for unified account hosts#1517

Merged
hectorcast-db merged 2 commits intomainfrom
fix-get-workspace-client-spog-hosts
Mar 5, 2026
Merged

Fix GetWorkspaceClient for unified account hosts#1517
hectorcast-db merged 2 commits intomainfrom
fix-get-workspace-client-spog-hosts

Conversation

@hectorcast-db
Copy link
Copy Markdown
Contributor

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

Changes

Fixes GetWorkspaceClient for unified account hosts that don't follow the standard environment DNS zone pattern (e.g. SPOG/unified hosts).

Previously, the workspace host was always constructed via DeploymentURL(ws.DeploymentName), which blindly appends the environment's DNS zone. For unified hosts where the account and workspace share the same host, this produces an incorrect URL.

The new workspaceHost() helper checks whether the account host matches the environment's DNS zone:

  • Matches → standard environment, construct workspace URL from ws.DeploymentName as before
  • Doesn't match, or DNS zone is empty → unified/SPOG host, reuse the account host as the workspace host

Also propagates AccountID and Experimental_IsUnifiedHost to the derived workspace config when in unified host mode.

Tests

Added unit tests in account_functions_test.go covering:

  • Standard AWS account host (with and without scheme)
  • Standard Azure account host
  • Non-standard SPOG host (returns account host as-is)
  • Empty DNS zone (returns account host as-is)

NO_CHANGELOG=true

Previously, GetWorkspaceClient always constructed the workspace host
using DeploymentURL(ws.DeploymentName), which appends the environment's
DNS zone. This breaks for unified/SPOG hosts that don't follow the
standard DNS zone pattern — the account and workspace share the same host.

Now, workspaceHost() checks whether the account host matches the
environment's DNS zone. If it does, the workspace URL is constructed
normally from the deployment name. Otherwise (or if the DNS zone is
empty), the account host is reused as the workspace host.

Also propagates AccountID and Experimental_IsUnifiedHost to the
workspace config when operating in unified host mode.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Hector Castejon Diaz <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Signed-off-by: Hector Castejon Diaz <[email protected]>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 5, 2026

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

Inputs:

  • PR number: 1517
  • Commit SHA: 16250979cf8311d4e207ec792c1754c8d1f10ba0

Checks will be approved automatically on success.

@hectorcast-db hectorcast-db changed the title Fix GetWorkspaceClient for non-standard (SPOG/unified) account hosts Fix GetWorkspaceClient for unified account hosts Mar 5, 2026
@hectorcast-db hectorcast-db requested a review from tanmay-db March 5, 2026 09:42
@hectorcast-db hectorcast-db added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit bf7e53c Mar 5, 2026
15 of 16 checks passed
@hectorcast-db hectorcast-db deleted the fix-get-workspace-client-spog-hosts branch March 5, 2026 11:57
github-merge-queue bot pushed a commit that referenced this pull request Mar 5, 2026
<!--
  This template provides a recommended structure for PR descriptions.
  Adapt it freely — the goal is clarity, not rigid compliance.
The three-section format (Summary / Why / What Changed) helps reviewers
understand the change quickly and makes the PR easier to revisit later.
-->

## Summary
Adding an entry in NEXT_CHANGELOG.md for recent merged changes:
* Fix `GetWorkspaceClient` for unified account hosts
([#1517](#1517)).
* Add test for `GetWorkspaceClient` with SPOG host
([#1518](#1518)).
<!--
One or two sentences describing what this PR changes and what it
enables.
  Focus on the effect, not the implementation details.

  Example:
    Extracts the credentials chain iteration logic into a reusable
    `NewCredentialsChain` constructor so that internal tools can compose
their own authentication chains from individual credential strategies.
-->

## Why
Tagging workflow doesn't trigger a release if NEXT_CHANGELOG.md is empty
<!--
Explain the problem that motivated this change. A reviewer who reads
only
this section should understand why the PR exists and what problem it
solves.

- Start with the status quo: how things work today and what limitation
exists.
- Explain who is affected and what they cannot do (or must work around).
  - If alternatives were considered and rejected, briefly mention why.
  - End with how this PR addresses the gap.

  The "why" is the most important part of a PR description — it usually
  cannot be inferred from the code itself.
-->

## What changed

### Interface changes

<!--
New or modified public API surface: types, functions, configuration
options.
Use backticks for code references. Write "None." if there are no
changes.

  Example:
- **`NewCredentialsChain(...CredentialsStrategy) CredentialsStrategy`**
—
Takes an ordered list of credential strategies and returns a strategy
      that tries them in sequence.
-->

### Behavioral changes

<!--
User-visible behavior changes: different defaults, changed error
messages,
new side effects, performance characteristics. Write "None." if this is
a
  pure refactor — this explicitly reassures reviewers.
-->

### Internal changes

<!--
  Refactoring, file moves, implementation details, test infrastructure.
  Things that don't affect the public API or user-visible behavior.
-->

## How is this tested?

<!--
Describe any tests you have done, especially tests that are not part of
the unit tests (e.g. local tests, integration tests, manual
verification).

ALWAYS ANSWER THIS QUESTION: answer with "N/A" if tests are not
applicable
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
answering "Not tested" if the PR has not been tested. Being clear about
what
has been done and not done provides important context to the reviewers.
-->

N/A
deco-sdk-tagging bot added a commit that referenced this pull request Mar 5, 2026
## Release v0.118.0

### Internal Changes

* Fix `GetWorkspaceClient` for unified account hosts ([#1517](#1517)).
* Add test for `GetWorkspaceClient` with SPOG host ([#1518](#1518)).
github-merge-queue bot pushed a commit to databricks/cli that referenced this pull request Mar 10, 2026
## Changes

- Bump `github.com/databricks/databricks-sdk-go` from v0.117.0 to
v0.119.0
- Update OpenAPI SHA
- Regenerate CLI code via `make generate`

<details><summary>SDK v0.117 -> v0.119.0 changelog</summary>
<p>

## Release v0.119.0 (2026-03-09)

### API Changes
* Add
[dataclassification](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dataclassification)
and
[knowledgeassistants](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/knowledgeassistants)
packages.
* Add
[w.DataClassification](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dataclassification#DataClassificationAPI)
workspace-level service.
* Add
[w.KnowledgeAssistants](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/knowledgeassistants#KnowledgeAssistantsAPI)
workspace-level service.
* Add `GenieCreateEvalRun`, `GenieGetEvalResultDetails`,
`GenieGetEvalRun`, `GenieListEvalResults` and `GenieListEvalRuns`
methods for
[w.Genie](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#GenieAPI)
workspace-level service.
* Add `TelemetryExportDestinations` field for
[apps.App](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#App).


## Release v0.118.0 (2026-03-05)

### Internal Changes

* Fix `GetWorkspaceClient` for unified account hosts
([#1517](databricks/databricks-sdk-go#1517)).
* Add test for `GetWorkspaceClient` with SPOG host
([#1518](databricks/databricks-sdk-go#1518)).

</p>
</details>

## Tests

- [x] `make lintfull`
- [x] go test ./internal/build ./bundle/internal/schema
./bundle/direct/dresources ./bundle/config/resources
- [x] `make checks`
rauchy pushed a commit to databricks/cli that referenced this pull request Mar 17, 2026
## Changes

- Bump `github.com/databricks/databricks-sdk-go` from v0.117.0 to
v0.119.0
- Update OpenAPI SHA
- Regenerate CLI code via `make generate`

<details><summary>SDK v0.117 -> v0.119.0 changelog</summary>
<p>

## Release v0.119.0 (2026-03-09)

### API Changes
* Add
[dataclassification](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dataclassification)
and
[knowledgeassistants](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/knowledgeassistants)
packages.
* Add
[w.DataClassification](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dataclassification#DataClassificationAPI)
workspace-level service.
* Add
[w.KnowledgeAssistants](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/knowledgeassistants#KnowledgeAssistantsAPI)
workspace-level service.
* Add `GenieCreateEvalRun`, `GenieGetEvalResultDetails`,
`GenieGetEvalRun`, `GenieListEvalResults` and `GenieListEvalRuns`
methods for
[w.Genie](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/dashboards#GenieAPI)
workspace-level service.
* Add `TelemetryExportDestinations` field for
[apps.App](https://pkg.go.dev/github.com/databricks/databricks-sdk-go/service/apps#App).


## Release v0.118.0 (2026-03-05)

### Internal Changes

* Fix `GetWorkspaceClient` for unified account hosts
([#1517](databricks/databricks-sdk-go#1517)).
* Add test for `GetWorkspaceClient` with SPOG host
([#1518](databricks/databricks-sdk-go#1518)).

</p>
</details>

## Tests

- [x] `make lintfull`
- [x] go test ./internal/build ./bundle/internal/schema
./bundle/direct/dresources ./bundle/config/resources
- [x] `make checks`
github-merge-queue bot pushed a commit to databricks/databricks-sdk-java that referenced this pull request Mar 19, 2026
## 🥞 Stacked PR

- [#710 Add cloud field to
HostMetadata](#710)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/710/files)]
- [**#711 Fix GetWorkspaceClient for unified account
hosts**](#711)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/711/files)]
- [#712 Add test for GetWorkspaceClient with SPOG
host](#712)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/712/files)]
- [#713 Call resolveHostMetadata on Config
init](#713)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/713/files)]
- [#714 Resolve TokenAudience from host metadata for account
hosts](#714)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/714/files)]
- [#718 Make GCP SA token refresh
non-blocking](#718)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/718/files)]
- [#719 Add integration test for host metadata
resolution](#719)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/719/files)]
- [#720 Remove unified flag usage, rely on host
metadata](#720)
[[Files](https://github.com/databricks/databricks-sdk-java/pull/720/files)]

---------
## Summary

Port of Go SDK
[#1517](databricks/databricks-sdk-go#1517).

Fixes `getWorkspaceClient()` for unified account hosts that don't follow
the standard environment DNS zone pattern (e.g. SPOG/unified hosts).
Previously, the workspace host was always constructed via
`getDeploymentUrl(ws.getDeploymentName())`, which blindly appends the
environment's DNS zone. For unified hosts where the account and
workspace share the same host, this produces an incorrect URL.

**Changes:**
- `AccountClient.getWorkspaceClient()`: clones config instead of
mutating `this.config` for unified hosts

**Note:** `AccountClient.java` is a generated file. The template needs
to be updated.

`NO_CHANGELOG=true`

## Test plan
- [x] `AccountClientTest`: existing tests pass
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