Skip to content

Fix incorrect ?w= workspace parameter in resource URLs - #6754

Merged
andrewnester merged 8 commits into
mainfrom
fix/spog-regression
Sep 25, 2026
Merged

andrewnester merged 8 commits into
mainfrom
fix/spog-regression

Conversation

@andrewnester

@andrewnester andrewnester commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Fix incorrect ?w= workspace parameter in resource URLs

Why

PR #5369 changed to call auth.ResolveWorkspaceID() instead of CurrentWorkspaceID().
ResolveWorkspaceID has a fast-path that returns Config.WorkspaceID without hitting the API. That field is populated from multiple sources: the user's .databrickscfg profile workspace_id, a ?o=/?w= embedded in the host URL, the bundle's workspace.workspace_id, etc. Any of which can contain a value that doesn't match the workspace to which the bundle is actually deployed.

CurrentWorkspaceID() is always authoritative: it calls /api/2.0/preview/scim/v2/Me and reads X-Databricks-Org-Id from the response header of the actual connected workspace.

When the two diverge (e.g. a profile configured for workspace A is used with a bundle that targets workspace B), the old fast-path embedded the wrong workspace ID in ?w=, causing the Databricks UI to navigate to an unexpected workspace. This was compounded by a frontend bug in which a numeric ?w= value bypasses pub-conf reconciliation and immediately boots on the passed-in workspace, with no server-side correction.

Tests

Added a unit test

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

Files: acceptance/bundle/user_agent/output.txt, acceptance/bundle/user_agent/simple/out.requests.summary.direct.json, acceptance/bundle/user_agent/simple/out.requests.summary.terraform.json
Suggested: @denik
Also eligible: @janniklasrose, @shreyas-goenka, @pietern, @anton-107, @lennartkats-db

/bundle/ - needs approval

Files: bundle/config/mutator/initialize_urls.go, bundle/config/mutator/initialize_urls_test.go
Suggested: @denik
Also eligible: @janniklasrose, @shreyas-goenka, @pietern, @anton-107, @lennartkats-db

General files (require maintainer)

Files: .nextchanges/bundles/fix-jobs-link-w-param-workspace-switch.md
Based on git history:

  • @denik -- recent work in .nextchanges/bundles/, bundle/config/mutator/, acceptance/bundle/user_agent/

Any maintainer (@anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db, @rugpanov, @rclarey) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: e4c1af7

Run: 36120058738

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 17 5:33
✅​ aws windows 278 15 5:41
✅​ azure linux 275 17 6:11
✅​ azure windows 277 15 5:43
✅​ gcp linux 276 17 5:24
✅​ gcp windows 278 15 3:32
Top 6 slowest tests (at least 2 minutes):
duration env testname
5:38 aws windows TestAccept
4:33 azure windows TestAccept
4:07 aws linux TestAccept
4:01 gcp linux TestAccept
3:51 azure linux TestAccept
3:30 gcp windows TestAccept

Comment thread bundle/config/mutator/initialize_urls.go Outdated
// non-numeric Config.WorkspaceID (e.g. a UUID connection-style identifier) is
// passed through unchanged into the ?w= parameter. The numeric-mismatch check
// is skipped because such IDs cannot be compared against an integer org ID.
func TestInitializeURLsApplyNonNumericConfigPassedThrough(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

make this and the case below an acceptance test? Would be simpler?

Comment thread .nextchanges/bundles/fix-jobs-link-w-param-workspace-switch.md Outdated
Comment thread bundle/config/mutator/initialize_urls.go Outdated
@andrewnester
andrewnester requested review from a team as code owners September 25, 2026 09:42
@github-actions github-actions Bot added the DABs DABs related issues label Sep 25, 2026
@andrewnester
andrewnester added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit 6f01b0f Sep 25, 2026
31 checks passed
@andrewnester
andrewnester deleted the fix/spog-regression branch September 25, 2026 10:38
deco-sdk-tagging Bot added a commit that referenced this pull request Sep 30, 2026
## Release v1.19.0

### CLI

 * Honor `CLAUDE_CONFIG_DIR` in `aitools` commands. ([#6838](#6838))
 * Added `--ttl` and `--no-expiry` flags to `databricks postgres create-branch` so a branch's expiration can be set without hand-writing a `--json` spec. `--ttl` accepts the REST API duration form (`604800s`), a Go duration (`168h`), or day/week units (`7d`, `3w`); `--no-expiry` creates a branch that never expires. One of `--ttl`, `--no-expiry`, or a spec expiration in `--json` is required. ([#6313](#6313))
 * `databricks ssh connect` serverless sessions now provide Claude Code and Codex configured with Unity Gateway out of the box. ([#6885](#6885))

### AI Runtime

 * Add `databricks air images push` (Preview) to configure Docker authentication and push container images to Databricks Artifact Registry. ([#6869](#6869))
 * `air run` now grants the configured `permissions` on the MLflow experiment as well as the job. ([#6870](#6870))

### Bundles

 * Add libraries field to clusters. ([#6831](#6831))
 * Error out when a configured `workspace_id` does not match the connected workspace, instead of silently using it in resource URLs emitted by `bundle summary`. ([#6754](#6754))
 * Fix spurious recreation of Lakebase (Postgres) branches, roles, and catalogs when the referenced project is updated in place: an in-place project change (e.g. `display_name`) no longer forces a delete + create of resources that reference the project's or branch's `name`. ([#6865](#6865))
 * Direct engine now detects and applies an explicitly configured integer zero (e.g. `gcp_attributes.local_ssd_count: 0`) added to a resource first deployed without the field. ([#6867](#6867))
 * Migrate existing Terraform deployment state to the direct engine before deploying (previously done after a Terraform deploy), so the deploy runs on the direct engine. ([#6749](#6749))
 * The `postgres_snapshot_schedules` resource (introduced in [v1.16.0](https://github.com/databricks/cli/releases/tag/v1.16.0)) is now marked Beta and is no longer available in PyDABs, matching the other `postgres_*` resources; configure it in YAML instead. ([#6887](#6887))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants