Skip to content

databricks experimental open: emit ?w= URL query parameter#5369

Open
Divyansh-db wants to merge 4 commits into
mainfrom
emit-workspace-id-url-param
Open

databricks experimental open: emit ?w= URL query parameter#5369
Divyansh-db wants to merge 4 commits into
mainfrom
emit-workspace-id-url-param

Conversation

@Divyansh-db
Copy link
Copy Markdown

Summary

The Databricks UI is migrating from ?o=<workspace-id> to ?w=<workspace-id> as the SPOG URL query parameter, matching the recent workspace addressing header rename. This PR switches BuildResourceURL in libs/workspaceurls to write ?w= when appending the workspace identifier.

This affects URLs printed by databricks experimental open. The legacy ?o= URL spelling remains a valid input anywhere the CLI parses host URLs; only the emitted form changes.

Scope

  • libs/workspaceurls/urls.goworkspaceBaseURL now adds w=<id>, docstring on BuildResourceURL updated.
  • libs/workspaceurls/urls_test.go — expected URLs flipped.
  • cmd/experimental/workspace_open_test.go — expected URLs flipped.
  • acceptance/experimental/open/output.txt — regenerated via ./task test-update.

bundle/config/mutator/initialize_urls.go also adds a workspace identifier query parameter, but it does so before calling ResourceURL with an already-built baseURL, so this change does not affect bundle output. The bundle path can flip in a separate change.

Test plan

  • go test ./libs/workspaceurls/... ./cmd/experimental/... — green
  • go test ./acceptance -run 'TestAccept/experimental/open' — green (golden file regenerated)
  • ./task lint-q — 0 issues; ./task fmt — no changes

The Databricks UI is migrating from ?o=<workspace-id> to ?w=<workspace-id>
as the SPOG URL query parameter, matching the recent workspace addressing
header rename. Switch BuildResourceURL in libs/workspaceurls to write ?w=
when appending the workspace identifier. This affects URLs printed by
databricks experimental open.

The legacy ?o= URL spelling remains a valid input wherever the CLI parses
host URLs; only the emitted form changes.

bundle/config/mutator/initialize_urls.go also adds a workspace identifier
query parameter, but it does so before calling ResourceURL with an
already-built baseURL, so this change does not affect bundle output.
# Conflicts:
#	cmd/experimental/workspace_open_test.go
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented May 29, 2026

Commit: 22d9bd7

Run: 26644484219

@andrewnester andrewnester requested a review from simonfaltum May 29, 2026 12:52

values := baseURL.Query()
values.Add("o", orgID)
values.Add("w", wsID)
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.

@andrewnester andrewnester self-requested a review May 29, 2026 12:57
Copy link
Copy Markdown
Contributor

@hectorcast-db hectorcast-db left a comment

Choose a reason for hiding this comment

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

Current code LGTM. I will review it again after the missing change is added.

bundle/config/mutator/initialize_urls.go is the bundle-side counterpart of
libs/workspaceurls/workspaceBaseURL: it appends ?o=<workspace-id> to every
resource URL printed by `databricks bundle summary`. Flip it to emit ?w=
to match the new workspace addressing convention.

The 12 bundle resource URL builders that consume the baseURL (alerts,
apps, pipelines, jobs, dashboards, experiments, models, model serving,
registered models, clusters, sql warehouses, vector search) all inherit
the new spelling without code changes since they just append the resource
path/fragment to the baseURL.

Updates:

- bundle/config/mutator/initialize_urls.go: emit ?w= instead of ?o=,
  rename local orgId → workspaceID, refresh the comment.
- bundle/config/mutator/initialize_urls_test.go: ~10 expected-URL
  assertions flipped from ?o= to ?w=.
- 18 acceptance/bundle/** golden files regenerated with ?w=.
- 12 acceptance/bundle/** test.toml scrub patterns widened from
  \?o=... to \?[ow]=... so they match both the new (?w=) and legacy
  (?o=) URL parameter forms.

`Run URL: ...?o=...` lines in run / deploy / spark task / integration_whl
fixtures are intentionally left as ?o= — those URLs come from the platform
API's RunPageUrl response field, not from CLI code, and the API response
side has not migrated yet (asymmetric migration; the platform still
echoes ?o= until the response-side rename ships).
The acceptance/pipelines tree exercises the pipelines-binary mode of the
CLI; `databricks pipelines deploy` and friends print resource URLs via
the same bundle/config/mutator/initialize_urls.go path that PR 3 just
flipped to ?w=. Regenerate the 19 affected golden files to match.

The open-after-deployment/output.txt golden is part of a macOS-only test
(its test.toml sets GOOS.windows = false and GOOS.linux = false) so
./task test-update can't regenerate it locally; that one is updated by
hand as a mass literal swap, which is the explicit exception called out
in .agent/rules/auto-generated-files.md.
Copy link
Copy Markdown
Member

@simonfaltum simonfaltum left a comment

Choose a reason for hiding this comment

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

Reviewed the URL emission changes and the related stack. The only remaining nit I found on this PR is that this is user-visible output and does not add a NEXT_CHANGELOG.md entry, but I do not think that should block approval. The ?w= parsing concern is handled in the companion PR #5373, so this stack should land with that parser support before/alongside this change.

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.

5 participants