Skip to content

config: also extract ?w= from Host URL#1704

Merged
Divyansh-db merged 1 commit into
mainfrom
divyansh-vijayvergia_data/host-extract-w-query-param
May 28, 2026
Merged

config: also extract ?w= from Host URL#1704
Divyansh-db merged 1 commit into
mainfrom
divyansh-vijayvergia_data/host-extract-w-query-param

Conversation

@Divyansh-db
Copy link
Copy Markdown
Contributor

Changes

Follow-up to #1699, which started promoting ?o=/?workspace_id= and ?a=/?account_id= from Config.Host into Config.WorkspaceID/Config.AccountID during fixHostIfNeeded.

?w= is the unified workspace addressing query parameter that supersedes ?o=/?workspace_id=. It accepts a broader range of workspace identifier formats — both classic numeric workspace IDs and other identifier formats the server understands — so the numeric-only validation applied to ?o=/?workspace_id= is intentionally not applied to ?w=.

Priority order in workspaceIDFromQuery becomes:

  1. ?w= — any non-empty value
  2. ?o= — numeric only
  3. ?workspace_id= — numeric only

Existing Config.WorkspaceID is still never overwritten.

Tests

Four cases added to the existing TestConfig_fixHostIfNeeded_extractsWorkspaceIDFromQuery table-driven test:

  • ?w=12345 is promoted to Config.WorkspaceID.
  • ?w=7a99b43c-b46c-432b-b0a7-814217701909 (UUID-shaped) is promoted as-is.
  • ?w= takes precedence over ?o= when both appear.
  • An existing Config.WorkspaceID is preserved when ?w= is present.

make fmt test lint clean.

NO_CHANGELOG=true

Builds on #1699, which promotes ?o=/?workspace_id= and ?a=/?account_id=
from the Host URL into Config.WorkspaceID/Config.AccountID during
fixHostIfNeeded.

?w= is the unified workspace addressing query parameter that supersedes
?o=/?workspace_id=. Unlike the older forms, ?w= accepts a broader range of
workspace identifier formats — both classic numeric workspace IDs and other
identifier formats the server understands — so the numeric-only validation
applied to ?o=/?workspace_id= is intentionally not applied to ?w=.

Priority order in workspaceIDFromQuery becomes:
  1. ?w=  (any non-empty value)
  2. ?o=  (numeric only)
  3. ?workspace_id=  (numeric only)

Existing Config.WorkspaceID is still never overwritten.

Tests added to the existing table-driven
TestConfig_fixHostIfNeeded_extractsWorkspaceIDFromQuery:
  - ?w= with a numeric value is promoted
  - ?w= with a non-numeric (UUID-shaped) value is promoted as-is
  - ?w= takes precedence over ?o= when both are present
  - existing Config.WorkspaceID is preserved over ?w=

NO_CHANGELOG=true

Co-authored-by: Isaac
Signed-off-by: Divyansh Vijayvergia <divyansh.vijayvergia@databricks.com>
@Divyansh-db Divyansh-db temporarily deployed to test-trigger-is May 28, 2026 12:15 — with GitHub Actions Inactive
@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-go

Inputs:

  • PR number: 1704
  • Commit SHA: 1300590b1bc6b258824c515f1ddf383af041dbe9

Checks will be approved automatically on success.

@Divyansh-db Divyansh-db enabled auto-merge May 28, 2026 12:30
@Divyansh-db Divyansh-db added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 6da9c9a May 28, 2026
14 checks passed
@Divyansh-db Divyansh-db deleted the divyansh-vijayvergia_data/host-extract-w-query-param branch May 28, 2026 12:52
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