From b0d2abc933dc3d9b60706fddee5ebe891ccb12d8 Mon Sep 17 00:00:00 2001 From: Anton Forsberg Date: Mon, 29 Jun 2026 08:16:05 +0000 Subject: [PATCH 1/2] Document `+` modifier syntax in `bundle run --only` help `bundle run --only` accepts task keys to run a subset of a job's tasks. A task key may be prefixed with `+` (also run upstream tasks) or suffixed with `+` (also run downstream tasks); document that in the flag's help text. Co-authored-by: Isaac --- NEXT_CHANGELOG.md | 1 + acceptance/bundle/help/bundle-run/output.txt | 2 +- bundle/run/job_options.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index 57d93cb0fcd..41591ff86b7 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -11,6 +11,7 @@ ### Bundles * `bundle generate job` now downloads workspace files referenced by `spark_python_task`, rewriting them to a relative path like it already does for notebooks. Git-sourced files and cloud URIs are left untouched ([#5799](https://github.com/databricks/cli/pull/5799)). + * `bundle run --only` help now documents the `+` modifier syntax: prefix a task key with `+` to also run its upstream tasks, or suffix it with `+` for downstream tasks ([#5760](https://github.com/databricks/cli/pull/5760)). ### Dependency updates diff --git a/acceptance/bundle/help/bundle-run/output.txt b/acceptance/bundle/help/bundle-run/output.txt index 0c91c15ccd4..a6b453c8834 100644 --- a/acceptance/bundle/help/bundle-run/output.txt +++ b/acceptance/bundle/help/bundle-run/output.txt @@ -38,7 +38,7 @@ Usage: databricks bundle run [flags] [KEY] Job Flags: - --only strings comma separated list of task keys to run + --only strings comma separated list of task keys to run. Prefix a key with + to also run its upstream tasks. Suffix with + to also run its downstream tasks --params stringToString comma separated k=v pairs for job parameters (default []) Job Task Flags: diff --git a/bundle/run/job_options.go b/bundle/run/job_options.go index 8bbd52acab8..ce5e2004a9e 100644 --- a/bundle/run/job_options.go +++ b/bundle/run/job_options.go @@ -34,7 +34,7 @@ type JobOptions struct { func (o *JobOptions) DefineJobOptions(fs *flag.FlagSet) { fs.StringToStringVar(&o.jobParams, "params", nil, "comma separated k=v pairs for job parameters") - fs.StringSliceVar(&o.only, "only", nil, "comma separated list of task keys to run") + fs.StringSliceVar(&o.only, "only", nil, "comma separated list of task keys to run. Prefix a key with + to also run its upstream tasks. Suffix with + to also run its downstream tasks") } func (o *JobOptions) DefineTaskOptions(fs *flag.FlagSet) { From 71d5c4b45648d0d3e59ba2a7ab0702e187fb1d92 Mon Sep 17 00:00:00 2001 From: Anton Forsberg Date: Mon, 29 Jun 2026 09:51:18 +0000 Subject: [PATCH 2/2] acceptance: cover `+` modifier passthrough in `bundle run --only` Add a partial_run case asserting `--only +task_1,task_2+` forwards unchanged to the run-now `only` field, proving the CLI does not mangle or reject the upstream/downstream modifier syntax documented on the flag. Co-authored-by: Isaac --- .../bundle/run/jobs/partial_run/output.txt | 28 +++++++++++++++++++ acceptance/bundle/run/jobs/partial_run/script | 4 +++ 2 files changed, 32 insertions(+) diff --git a/acceptance/bundle/run/jobs/partial_run/output.txt b/acceptance/bundle/run/jobs/partial_run/output.txt index 169f0b58089..3927923c5d3 100644 --- a/acceptance/bundle/run/jobs/partial_run/output.txt +++ b/acceptance/bundle/run/jobs/partial_run/output.txt @@ -118,3 +118,31 @@ Hello from notebook2! ] } } + +>>> [CLI] bundle run my_job --only +task_1,task_2+ +Run URL: [DATABRICKS_URL]/jobs/[NUMID]/runs/[NUMID]?o=[NUMID] + +[TIMESTAMP] "my_job" RUNNING +[TIMESTAMP] "my_job" TERMINATED SUCCESS +Output: +======= +Task task_1: +Hello from notebook1! + +======= +Task task_2: +Hello from notebook2! + + +>>> print_requests.py //jobs/run-now +{ + "method": "POST", + "path": "/api/2.2/jobs/run-now", + "body": { + "job_id": [NUMID], + "only": [ + "+task_1", + "task_2+" + ] + } +} diff --git a/acceptance/bundle/run/jobs/partial_run/script b/acceptance/bundle/run/jobs/partial_run/script index 3854e33c1c2..78ce25d514a 100644 --- a/acceptance/bundle/run/jobs/partial_run/script +++ b/acceptance/bundle/run/jobs/partial_run/script @@ -18,3 +18,7 @@ trace musterr $CLI bundle run my_job --only non_existent_task,task_1 # We expect these values to be send through trace $CLI bundle run my_job --only "task1.table1,task2>,task3>table3" trace print_requests.py //jobs/run-now + +# + modifiers (run upstream/downstream tasks) are forwarded unchanged +trace $CLI bundle run my_job --only "+task_1,task_2+" +trace print_requests.py //jobs/run-now