Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

### Bundles
* `bundle run` now prints the modern job run URL (`/jobs/<id>/runs/<id>`) so that non-admin users permitted to view the run are taken to the run instead of the workspace homepage.
* `bundle run` now prints the modern pipeline update URL (`/pipelines/<id>/updates/<id>`) instead of the legacy `#joblist` hash-fragment URL, mirroring the job run URL change so the printed URL uses the modern path form.

### Dependency updates

Expand Down
8 changes: 4 additions & 4 deletions acceptance/bundle/run/refresh-flags/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Deployment complete!

=== Running pipeline with --refresh flag and specific tables
>>> [CLI] bundle run my_pipeline --refresh table1,table2
Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -25,7 +25,7 @@ Update ID: [UUID]

=== Running pipeline with --full-refresh-all flag
>>> [CLI] bundle run my_pipeline --full-refresh-all
Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -40,7 +40,7 @@ Update ID: [UUID]

=== Running pipeline with --full-refresh flag and specific tables
>>> [CLI] bundle run my_pipeline --full-refresh table1,table2
Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -58,7 +58,7 @@ Update ID: [UUID]

=== Running pipeline with --full-refresh flag and --refresh flag
>>> [CLI] bundle run my_pipeline --full-refresh table1,table2 --refresh table3,table4
Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
4 changes: 2 additions & 2 deletions acceptance/pipelines/dry-run/dry-run-pipeline/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]
{
Expand All @@ -29,7 +29,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]
{
Expand Down
2 changes: 1 addition & 1 deletion acceptance/pipelines/dry-run/no-wait/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]
2 changes: 1 addition & 1 deletion acceptance/pipelines/dry-run/restart/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
4 changes: 2 additions & 2 deletions acceptance/pipelines/e2e/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down Expand Up @@ -80,7 +80,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
2 changes: 1 addition & 1 deletion acceptance/pipelines/run/no-wait/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
8 changes: 4 additions & 4 deletions acceptance/pipelines/run/refresh-flags/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -39,7 +39,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -63,7 +63,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand All @@ -90,7 +90,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
2 changes: 1 addition & 1 deletion acceptance/pipelines/run/restart/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
2 changes: 1 addition & 1 deletion acceptance/pipelines/run/run-info/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/test-update-123
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/test-update-123

[TIMESTAMP] update_progress "Update test-update-123 is COMPLETED."
[TIMESTAMP] update_progress "Update test-update-123 is RUNNING."
Expand Down
2 changes: 1 addition & 1 deletion acceptance/pipelines/stop/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Recommendation: This command runs the last deployed version of the code

If you've made local changes, run 'databricks pipelines deploy' first to ensure they are included.

Update URL: [DATABRICKS_URL]/#joblist/pipelines/[UUID]/updates/[UUID]
Update URL: [DATABRICKS_URL]/pipelines/[UUID]/updates/[UUID]

Update ID: [UUID]

Expand Down
8 changes: 6 additions & 2 deletions bundle/run/progress/pipeline_events.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package progress

import "fmt"
import (
"fmt"

"github.com/databricks/cli/libs/workspaceurls"
)

type PipelineUpdateUrlEvent struct {
Type string `json:"type"`
Expand All @@ -14,7 +18,7 @@ func NewPipelineUpdateUrlEvent(host, updateId, pipelineId string) *PipelineUpdat
Type: "pipeline_update_url",
UpdateId: updateId,
PipelineId: pipelineId,
Url: fmt.Sprintf("%s/#joblist/pipelines/%s/updates/%s", host, pipelineId, updateId),
Url: fmt.Sprintf("%s/%s", host, workspaceurls.PipelineUpdatePath(pipelineId, updateId)),
}
}

Expand Down
15 changes: 15 additions & 0 deletions libs/workspaceurls/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ func JobRunPath(jobID, runID string) string {
return fmt.Sprintf("jobs/%s/runs/%s", jobID, runID)
}

// PipelineUpdatePath returns the modern workspace path for a pipeline update, of
// the form
//
// pipelines/<pipelineID>/updates/<updateID>
//
// Callers join this onto a workspace base URL. The CLI historically emitted a
// legacy hash-fragment URL (#joblist/pipelines/<id>/updates/<id>); this switches
// to the modern path form for consistency with the rest of the package and with
// the job run URL fix, where the legacy fragment form was found not to resolve
// for non-admin users permitted to view the run.
// See https://github.com/databricks/cli/issues/5142.
func PipelineUpdatePath(pipelineID, updateID string) string {
return fmt.Sprintf("pipelines/%s/updates/%s", pipelineID, updateID)
}

// ResourceURL constructs a workspace URL for a named resource type and ID.
func ResourceURL(baseURL url.URL, resourceType, id string) string {
resourceType = resolveAlias(resourceType)
Expand Down
4 changes: 4 additions & 0 deletions libs/workspaceurls/urls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func TestJobRunPath(t *testing.T) {
assert.Equal(t, "jobs/123/runs/456", JobRunPath("123", "456"))
}

func TestPipelineUpdatePath(t *testing.T) {
assert.Equal(t, "pipelines/abc-def/updates/upd-1", PipelineUpdatePath("abc-def", "upd-1"))
}

func TestResourceTypes(t *testing.T) {
types := ResourceTypes()
assert.NotEmpty(t, types)
Expand Down
Loading