Skip to content

Commit c71ec40

Browse files
authored
databricks experimental open: emit ?w= URL query parameter (#5369)
## 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.go` — `workspaceBaseURL` 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 - [x] `go test ./libs/workspaceurls/... ./cmd/experimental/...` — green - [x] `go test ./acceptance -run 'TestAccept/experimental/open'` — green (golden file regenerated) - [x] `./task lint-q` — 0 issues; `./task fmt` — no changes
1 parent ea9ff34 commit c71ec40

67 files changed

Lines changed: 312 additions & 189 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

acceptance/bundle/bundle_tag/id/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Resources:
6868
Jobs:
6969
foo:
7070
Name: Untitled
71-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
71+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
7272

7373
>>> [CLI] bundle destroy --auto-approve
7474
The following resources will be deleted:

acceptance/bundle/bundle_tag/url/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Resources:
6868
Jobs:
6969
foo:
7070
Name: Untitled
71-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
71+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
7272

7373
>>> [CLI] bundle destroy --auto-approve
7474
The following resources will be deleted:

acceptance/bundle/bundle_tag/url_ref/out.summary.terraform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Resources:
77
Jobs:
88
bar:
99
Name: Untitled
10-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
10+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
1111
foo:
1212
Name: Untitled
13-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
13+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]

acceptance/bundle/deploy/wal/chain-3-jobs/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ Resources:
9898
Jobs:
9999
job_01:
100100
Name: job-01
101-
URL: [DATABRICKS_URL]/jobs/[JOB_01_ID]?o=[NUMID]
101+
URL: [DATABRICKS_URL]/jobs/[JOB_01_ID]?w=[NUMID]
102102
job_02:
103103
Name: job-02
104-
URL: [DATABRICKS_URL]/jobs/[JOB_02_ID]?o=[NUMID]
104+
URL: [DATABRICKS_URL]/jobs/[JOB_02_ID]?w=[NUMID]
105105
job_03:
106106
Name: job-03
107107
URL: (not deployed)

acceptance/bundle/deploy/wal/corrupted-wal-entry/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Resources:
2323
Jobs:
2424
another_valid:
2525
Name: another-valid
26-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
26+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
2727
valid_job:
2828
Name: valid-job
29-
URL: [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
29+
URL: [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
3030

3131
>>> cat .databricks/bundle/default/resources.json.wal.corrupted
3232
{"k":"resources.jobs.partial_write","v":{"__id__":"33","state":{"name":"partial-

acceptance/bundle/deployment/bind/database_instance/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Resources:
1414
Database instances:
1515
database_instance1:
1616
Name: test-instance-02
17-
URL: [DATABRICKS_URL]/compute/database-instances/test-instance-02?o=[NUMID]
17+
URL: [DATABRICKS_URL]/compute/database-instances/test-instance-02?w=[NUMID]
1818

1919
>>> [CLI] bundle deployment unbind database_instance1
2020
Updating deployment state...

acceptance/bundle/deployment/bind/pipelines/recreate/out.summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"name": "test-pipeline-[UNIQUE_NAME]",
1919
"storage": "/Shared/new_storage",
20-
"url": "[DATABRICKS_URL]/pipelines/[NEW_PIPELINE_ID]?o=[NUMID]"
20+
"url": "[DATABRICKS_URL]/pipelines/[NEW_PIPELINE_ID]?w=[NUMID]"
2121
}
2222
}
2323
}

acceptance/bundle/deployment/bind/pipelines/update/out.summary.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
],
2828
"name": "test-pipeline",
29-
"url": "[DATABRICKS_URL]/pipelines/[NEW_PIPELINE_ID]?o=[NUMID]"
29+
"url": "[DATABRICKS_URL]/pipelines/[NEW_PIPELINE_ID]?w=[NUMID]"
3030
}
3131
}
3232
},

acceptance/bundle/deployment/bind/sql_warehouse/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Resources:
1414
SQL Warehouses:
1515
sql_warehouse1:
1616
Name: DEFAULT Test SQL Warehouse
17-
URL: [DATABRICKS_URL]/sql/warehouses/[SQL-WAREHOUSE-ID]?o=[NUMID]
17+
URL: [DATABRICKS_URL]/sql/warehouses/[SQL-WAREHOUSE-ID]?w=[NUMID]
1818

1919
>>> [CLI] bundle deployment unbind sql_warehouse1
2020
Updating deployment state...

acceptance/bundle/open/output.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Deployment complete!
2020
=== Use a fake browser that just prints the URL it would have opened
2121
=== open after deployment
2222
>>> [CLI] bundle open foo
23-
Opening browser at [DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
24-
[DATABRICKS_URL]/jobs/[NUMID]?o=[NUMID]
23+
Opening browser at [DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
24+
[DATABRICKS_URL]/jobs/[NUMID]?w=[NUMID]
2525

2626
=== test auto-completion handler
2727
>>> [CLI] __complete bundle open ,

0 commit comments

Comments
 (0)