Skip to content

[draft] Add bundle deploy --exclude resource selector - #7348

Open
lennartkats-db wants to merge 6 commits into
mainfrom
codex/bundle-deploy-exclude-6978
Open

lennartkats-db wants to merge 6 commits into
mainfrom
codex/bundle-deploy-exclude-6978

Conversation

@lennartkats-db

@lennartkats-db lennartkats-db commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Add --exclude to bundle deploy and bundle plan so a direct-engine plan can omit named resources and their grants and permissions. Repeated selectors deduplicate; unknown or ambiguous names fail.
  • Reject a retained resource that depends on an excluded resource, even if unchanged. Protect ID references held by excluded deployed resources when a prerequisite would be deleted or receive a new ID. Ordering-only lifecycle.depends_on edges do not hold an ID reference.
  • Allow an excluded deployed job to keep its old immutable snapshot path while a recreated snapshot serves other jobs. The snapshot's delete operation leaves the old path available.
  • Reject --exclude with --select or when applying a saved --plan. A filtered plan can instead be generated with bundle plan --exclude and applied later.

Why

Deploying prerequisites before a small set of resources currently requires maintaining a growing --select list. Exclusion lets the first stage track new resources automatically while the dependency checks keep the partial plan safe.

Fixes #6978

Tests

  • go test ./bundle/deployplan ./bundle/direct ./bundle/phases ./cmd/bundle/...
  • go test ./acceptance -run 'TestAccept/bundle/select/exclude_basic' -count=1 -v (direct and DMS, fresh and saved plans)
  • go test ./acceptance -run 'TestAccept/bundle/select/exclude_immutable_snapshot' -count=1 -v (direct and DMS, excluded job keeps its old snapshot path)
  • go test ./acceptance -run 'TestAccept/bundle/deploy/immutable/select' -count=1 -v
  • go test ./acceptance -run 'TestAccept/bundle/help/bundle-deploy' -count=1 -v
  • ./task checks

This PR was written by Codex.

@lennartkats-db
lennartkats-db requested review from a team as code owners November 4, 2026 15:19
@lennartkats-db lennartkats-db added the software-factory PR produced by the software factories task label Nov 4, 2026
@lennartkats-db
lennartkats-db requested review from Sankalp-Mittal and removed request for Sankalp-Mittal and rclarey November 4, 2026 15:19
@github-actions github-actions Bot added the DABs DABs related issues label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 8895de678 | Workflow run

Regression test report

Selected 3 changed tests (limit=20, 0 not selected)

8 tests: regression=8 unreleased=0 coverage=0 failing=0
test branch main (8e70c8b) latest (v1.26.0)
TestAccept/bundle/help/bundle-deploy/DMS= ✅ ❌ ❌
TestAccept/bundle/help/bundle-deploy/DMS=true ✅ ❌ ❌
TestAccept/bundle/select/exclude_basic/DMS=/READPLAN= ✅ ❌ ❌
TestAccept/bundle/select/exclude_basic/DMS=/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/select/exclude_basic/DMS=true/READPLAN= ✅ ❌ ❌
TestAccept/bundle/select/exclude_basic/DMS=true/READPLAN=1 ✅ ❌ ❌
TestAccept/bundle/select/exclude_immutable_snapshot/DMS= ✅ ❌ ❌
TestAccept/bundle/select/exclude_immutable_snapshot/DMS=true ✅ ❌ ❌
TestAccept/bundle/help/bundle-deploy/DMS=: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/help/bundle-deploy/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-deployDMS=841229695/002/output.txt
        @@ -15,7 +15,6 @@
         Flags:
               --auto-approve          Skip interactive approvals that might be required for deployment.
           -c, --cluster-id string     Override cluster in the deployment with the given cluster ID.
        -      --exclude strings       Deploy all resources except the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
               --fail-on-active-runs   Fail if there are running jobs or pipelines in the deployment.
               --force                 Force-override Git branch validation.
               --force-lock            Force acquisition of deployment lock.

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/help/bundle-deploy/DMS=true: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/help/bundle-deploy/output.txt
        +++ /tmp/TestAcceptbundlehelpbundle-deployDMS=true2815204564/002/output.txt
        @@ -15,7 +15,6 @@
         Flags:
               --auto-approve          Skip interactive approvals that might be required for deployment.
           -c, --cluster-id string     Override cluster in the deployment with the given cluster ID.
        -      --exclude strings       Deploy all resources except the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
               --fail-on-active-runs   Fail if there are running jobs or pipelines in the deployment.
               --force                 Force-override Git branch validation.
               --force-lock            Force acquisition of deployment lock.

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_basic/DMS=/READPLAN=: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_basic/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_basicDMS=READPLAN=3483542718/002/output.txt
        @@ -1,96 +1,28 @@
         
         >>> [CLI] bundle plan --exclude jobs.deferred
        -create jobs.prerequisite
        +Error: unknown flag: --exclude
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Usage:
        +  databricks bundle plan [flags]
         
        ->>> [CLI] bundle plan --exclude jobs.deferred --exclude deferred
        -create jobs.prerequisite
        +Flags:
        +  -c, --cluster-id string   Override cluster in the deployment with the given cluster ID.
        +      --force               Force-override Git branch validation.
        +  -h, --help                help for plan
        +  -q, --quiet count         Reduce output: -q prints only the summary, -qq prints nothing on success.
        +      --select strings      Plan only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        ->>> [CLI] bundle plan --exclude jobs.prerequisite
        -Error: cannot exclude jobs.prerequisite: jobs.deferred depends on it through ${resources.jobs.prerequisite.id}; also exclude jobs.deferred or remove the dependency
         
        -
        ->>> [CLI] bundle deploy --exclude jobs.missing
        -Error: no such resource: jobs.missing
        -
        -
        ->>> [CLI] bundle deploy --select jobs.deferred --exclude jobs.prerequisite
        -Error: --select and --exclude cannot be used together
        -
        ->>> [CLI] bundle deploy --exclude jobs.deferred --plan plan.json
        -Error: --exclude cannot be used with --plan; generate a filtered plan with bundle plan --exclude, then apply it with --plan
        -
        ->>> env DATABRICKS_BUNDLE_ENGINE=terraform [CLI] bundle plan --exclude jobs.deferred
        -Error: the Terraform deployment engine has been removed in Databricks CLI v1.20.0
        -
        -Unset the DATABRICKS_BUNDLE_ENGINE environment variable (or set it to "direct") to deploy with the direct engine; existing Terraform state is migrated automatically. To keep using Terraform, revert to Databricks CLI v1.19.x.
        -See https://docs.databricks.com/dev-tools/bundles/direct for details
        -
        -=== Deploy prerequisites with --exclude
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.prerequisite
        -Files: 4 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged, 1 not selected
        -
        ->>> [CLI] bundle summary
        -Name: exclude-[UNIQUE_NAME]
        -Target: default
        -Workspace:
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -Resources:
        -  Jobs:
        -    deferred:
        -      Name: deferred-[UNIQUE_NAME]
        -      URL:  (not deployed)
        -    prerequisite:
        -      Name: prerequisite-[UNIQUE_NAME]
        -      URL:  [DATABRICKS_URL]/jobs/[PREREQUISITE_ID]?w=[WORKSPACE_ID]
        -
        ->>> print_requests.py --nostamp --sort //jobs
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/create",
        -  "body": {
        -    "deployment": {
        -      "kind": "BUNDLE",
        -      "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "prerequisite-[UNIQUE_NAME]",
        -    "queue": {
        -      "enabled": true
        -    }
        -  }
        -}
        -
        -=== Deploy deferred resource with --select
        -
        ->>> [CLI] bundle deploy --select jobs.deferred
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.deferred
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --exclude jobs.deferred
        -Error: cannot exclude jobs.deferred: deployed jobs.deferred still depends on jobs.prerequisite through ${resources.jobs.prerequisite.id}, which is planned for delete; also exclude jobs.prerequisite or update jobs.deferred first
        -
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         === Destroy
         
         >>> [CLI] bundle destroy --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.deferred
        -  delete resources.jobs.prerequisite
        +No active deployment found to destroy!
         
        -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -
        -Destroy: 2 deleted
        +Exit code: 1

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_basic/DMS=/READPLAN=1: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_basic/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_basicDMS=READPLAN=1566231233/002/output.txt
        @@ -1,96 +1,28 @@
         
         >>> [CLI] bundle plan --exclude jobs.deferred
        -create jobs.prerequisite
        +Error: unknown flag: --exclude
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Usage:
        +  databricks bundle plan [flags]
         
        ->>> [CLI] bundle plan --exclude jobs.deferred --exclude deferred
        -create jobs.prerequisite
        +Flags:
        +  -c, --cluster-id string   Override cluster in the deployment with the given cluster ID.
        +      --force               Force-override Git branch validation.
        +  -h, --help                help for plan
        +  -q, --quiet count         Reduce output: -q prints only the summary, -qq prints nothing on success.
        +      --select strings      Plan only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        ->>> [CLI] bundle plan --exclude jobs.prerequisite
        -Error: cannot exclude jobs.prerequisite: jobs.deferred depends on it through ${resources.jobs.prerequisite.id}; also exclude jobs.deferred or remove the dependency
         
        -
        ->>> [CLI] bundle deploy --exclude jobs.missing
        -Error: no such resource: jobs.missing
        -
        -
        ->>> [CLI] bundle deploy --select jobs.deferred --exclude jobs.prerequisite
        -Error: --select and --exclude cannot be used together
        -
        ->>> [CLI] bundle deploy --exclude jobs.deferred --plan plan.json
        -Error: --exclude cannot be used with --plan; generate a filtered plan with bundle plan --exclude, then apply it with --plan
        -
        ->>> env DATABRICKS_BUNDLE_ENGINE=terraform [CLI] bundle plan --exclude jobs.deferred
        -Error: the Terraform deployment engine has been removed in Databricks CLI v1.20.0
        -
        -Unset the DATABRICKS_BUNDLE_ENGINE environment variable (or set it to "direct") to deploy with the direct engine; existing Terraform state is migrated automatically. To keep using Terraform, revert to Databricks CLI v1.19.x.
        -See https://docs.databricks.com/dev-tools/bundles/direct for details
        -
        -=== Deploy prerequisites with --exclude
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.prerequisite
        -Files: 4 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged, 1 not selected
        -
        ->>> [CLI] bundle summary
        -Name: exclude-[UNIQUE_NAME]
        -Target: default
        -Workspace:
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -Resources:
        -  Jobs:
        -    deferred:
        -      Name: deferred-[UNIQUE_NAME]
        -      URL:  (not deployed)
        -    prerequisite:
        -      Name: prerequisite-[UNIQUE_NAME]
        -      URL:  [DATABRICKS_URL]/jobs/[PREREQUISITE_ID]?w=[WORKSPACE_ID]
        -
        ->>> print_requests.py --nostamp --sort //jobs
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/create",
        -  "body": {
        -    "deployment": {
        -      "kind": "BUNDLE",
        -      "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "prerequisite-[UNIQUE_NAME]",
        -    "queue": {
        -      "enabled": true
        -    }
        -  }
        -}
        -
        -=== Deploy deferred resource with --select
        -
        ->>> [CLI] bundle deploy --select jobs.deferred
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.deferred
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --exclude jobs.deferred
        -Error: cannot exclude jobs.deferred: deployed jobs.deferred still depends on jobs.prerequisite through ${resources.jobs.prerequisite.id}, which is planned for delete; also exclude jobs.prerequisite or update jobs.deferred first
        -
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         === Destroy
         
         >>> [CLI] bundle destroy --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.deferred
        -  delete resources.jobs.prerequisite
        +No active deployment found to destroy!
         
        -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -
        -Destroy: 2 deleted
        +Exit code: 1
        
FAIL

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_basic/DMS=true/READPLAN=: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_basic/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_basicDMS=trueREADPLAN=3424831241/002/output.txt
        @@ -1,96 +1,28 @@
         
         >>> [CLI] bundle plan --exclude jobs.deferred
        -create jobs.prerequisite
        +Error: unknown flag: --exclude
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Usage:
        +  databricks bundle plan [flags]
         
        ->>> [CLI] bundle plan --exclude jobs.deferred --exclude deferred
        -create jobs.prerequisite
        +Flags:
        +  -c, --cluster-id string   Override cluster in the deployment with the given cluster ID.
        +      --force               Force-override Git branch validation.
        +  -h, --help                help for plan
        +  -q, --quiet count         Reduce output: -q prints only the summary, -qq prints nothing on success.
        +      --select strings      Plan only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        ->>> [CLI] bundle plan --exclude jobs.prerequisite
        -Error: cannot exclude jobs.prerequisite: jobs.deferred depends on it through ${resources.jobs.prerequisite.id}; also exclude jobs.deferred or remove the dependency
         
        -
        ->>> [CLI] bundle deploy --exclude jobs.missing
        -Error: no such resource: jobs.missing
        -
        -
        ->>> [CLI] bundle deploy --select jobs.deferred --exclude jobs.prerequisite
        -Error: --select and --exclude cannot be used together
        -
        ->>> [CLI] bundle deploy --exclude jobs.deferred --plan plan.json
        -Error: --exclude cannot be used with --plan; generate a filtered plan with bundle plan --exclude, then apply it with --plan
        -
        ->>> env DATABRICKS_BUNDLE_ENGINE=terraform [CLI] bundle plan --exclude jobs.deferred
        -Error: the Terraform deployment engine has been removed in Databricks CLI v1.20.0
        -
        -Unset the DATABRICKS_BUNDLE_ENGINE environment variable (or set it to "direct") to deploy with the direct engine; existing Terraform state is migrated automatically. To keep using Terraform, revert to Databricks CLI v1.19.x.
        -See https://docs.databricks.com/dev-tools/bundles/direct for details
        -
        -=== Deploy prerequisites with --exclude
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.prerequisite
        -Files: 4 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged, 1 not selected
        -
        ->>> [CLI] bundle summary
        -Name: exclude-[UNIQUE_NAME]
        -Target: default
        -Workspace:
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -Resources:
        -  Jobs:
        -    deferred:
        -      Name: deferred-[UNIQUE_NAME]
        -      URL:  (not deployed)
        -    prerequisite:
        -      Name: prerequisite-[UNIQUE_NAME]
        -      URL:  [DATABRICKS_URL]/jobs/[PREREQUISITE_ID]?w=[WORKSPACE_ID]
        -
        ->>> print_requests.py --nostamp --sort //jobs
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/create",
        -  "body": {
        -    "deployment": {
        -      "kind": "BUNDLE",
        -      "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "prerequisite-[UNIQUE_NAME]",
        -    "queue": {
        -      "enabled": true
        -    }
        -  }
        -}
        -
        -=== Deploy deferred resource with --select
        -
        ->>> [CLI] bundle deploy --select jobs.deferred
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.deferred
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --exclude jobs.deferred
        -Error: cannot exclude jobs.deferred: deployed jobs.deferred still depends on jobs.prerequisite through ${resources.jobs.prerequisite.id}, which is planned for delete; also exclude jobs.prerequisite or update jobs.deferred first
        -
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         === Destroy
         
         >>> [CLI] bundle destroy --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.deferred
        -  delete resources.jobs.prerequisite
        +No active deployment found to destroy!
         
        -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -
        -Destroy: 2 deleted
        +Exit code: 1

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_basic/DMS=true/READPLAN=1: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_basic/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_basicDMS=trueREADPLAN=11465460348/002/output.txt
        @@ -1,96 +1,28 @@
         
         >>> [CLI] bundle plan --exclude jobs.deferred
        -create jobs.prerequisite
        +Error: unknown flag: --exclude
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Usage:
        +  databricks bundle plan [flags]
         
        ->>> [CLI] bundle plan --exclude jobs.deferred --exclude deferred
        -create jobs.prerequisite
        +Flags:
        +  -c, --cluster-id string   Override cluster in the deployment with the given cluster ID.
        +      --force               Force-override Git branch validation.
        +  -h, --help                help for plan
        +  -q, --quiet count         Reduce output: -q prints only the summary, -qq prints nothing on success.
        +      --select strings      Plan only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
         
        -Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged, 1 not selected
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
         
        ->>> [CLI] bundle plan --exclude jobs.prerequisite
        -Error: cannot exclude jobs.prerequisite: jobs.deferred depends on it through ${resources.jobs.prerequisite.id}; also exclude jobs.deferred or remove the dependency
         
        -
        ->>> [CLI] bundle deploy --exclude jobs.missing
        -Error: no such resource: jobs.missing
        -
        -
        ->>> [CLI] bundle deploy --select jobs.deferred --exclude jobs.prerequisite
        -Error: --select and --exclude cannot be used together
        -
        ->>> [CLI] bundle deploy --exclude jobs.deferred --plan plan.json
        -Error: --exclude cannot be used with --plan; generate a filtered plan with bundle plan --exclude, then apply it with --plan
        -
        ->>> env DATABRICKS_BUNDLE_ENGINE=terraform [CLI] bundle plan --exclude jobs.deferred
        -Error: the Terraform deployment engine has been removed in Databricks CLI v1.20.0
        -
        -Unset the DATABRICKS_BUNDLE_ENGINE environment variable (or set it to "direct") to deploy with the direct engine; existing Terraform state is migrated automatically. To keep using Terraform, revert to Databricks CLI v1.19.x.
        -See https://docs.databricks.com/dev-tools/bundles/direct for details
        -
        -=== Deploy prerequisites with --exclude
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.prerequisite
        -Files: 4 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 0 unchanged, 1 not selected
        -
        ->>> [CLI] bundle summary
        -Name: exclude-[UNIQUE_NAME]
        -Target: default
        -Workspace:
        -  User: [USERNAME]
        -  Path: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -Resources:
        -  Jobs:
        -    deferred:
        -      Name: deferred-[UNIQUE_NAME]
        -      URL:  (not deployed)
        -    prerequisite:
        -      Name: prerequisite-[UNIQUE_NAME]
        -      URL:  [DATABRICKS_URL]/jobs/[PREREQUISITE_ID]?w=[WORKSPACE_ID]
        -
        ->>> print_requests.py --nostamp --sort //jobs
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/create",
        -  "body": {
        -    "deployment": {
        -      "kind": "BUNDLE",
        -      "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/state/metadata.json"
        -    },
        -    "edit_mode": "UI_LOCKED",
        -    "format": "MULTI_TASK",
        -    "max_concurrent_runs": 1,
        -    "name": "prerequisite-[UNIQUE_NAME]",
        -    "queue": {
        -      "enabled": true
        -    }
        -  }
        -}
        -
        -=== Deploy deferred resource with --select
        -
        ->>> [CLI] bundle deploy --select jobs.deferred
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default/files...
        -Created jobs.deferred
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --exclude jobs.deferred
        -Error: cannot exclude jobs.deferred: deployed jobs.deferred still depends on jobs.prerequisite through ${resources.jobs.prerequisite.id}, which is planned for delete; also exclude jobs.prerequisite or update jobs.deferred first
        -
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
        -
         === Destroy
         
         >>> [CLI] bundle destroy --auto-approve
        -The following resources will be deleted:
        -  delete resources.jobs.deferred
        -  delete resources.jobs.prerequisite
        +No active deployment found to destroy!
         
        -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-[UNIQUE_NAME]/default
        -
        -Destroy: 2 deleted
        +Exit code: 1

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_immutable_snapshot/DMS=: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_immutable_snapshot/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_immutable_snapshotDMS=1840671269/002/output.txt
        @@ -11,12 +11,30 @@
         === Recreate the snapshot while excluding the deferred job
         
         >>> [CLI] bundle deploy --exclude jobs.deferred
        -Recreated internal_immutable_snapshots.immutable
        -Updated jobs.active
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 1 changed, 1 deleted, 0 unchanged, 1 not selected
        -OK: excluded job keeps its existing snapshot; active job uses the new one
        +Error: unknown flag: --exclude
         
        +Usage:
        +  databricks bundle deploy [flags]
        +
        +Flags:
        +      --auto-approve          Skip interactive approvals that might be required for deployment.
        +  -c, --cluster-id string     Override cluster in the deployment with the given cluster ID.
        +      --fail-on-active-runs   Fail if there are running jobs or pipelines in the deployment.
        +      --force                 Force-override Git branch validation.
        +      --force-lock            Force acquisition of deployment lock.
        +  -h, --help                  help for deploy
        +      --plan string           Path to a JSON plan file to apply instead of planning.
        +  -q, --quiet count           Reduce output: -q prints only the summary, -qq prints only warnings and errors.
        +      --select strings        Deploy only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
        +
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.active
        @@ -25,3 +42,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-immutable-[UNIQUE_NAME]/default
         
         Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.26.0): same output as main (8e70c8b)

TestAccept/bundle/select/exclude_immutable_snapshot/DMS=true: branch ✅ | main (8e70c8b) ❌ | latest (v1.26.0) ❌

main (8e70c8b):

acceptance_test.go:1374: Diff:
        --- bundle/select/exclude_immutable_snapshot/output.txt
        +++ /tmp/TestAcceptbundleselectexclude_immutable_snapshotDMS=true3900224828/002/output.txt
        @@ -11,12 +11,30 @@
         === Recreate the snapshot while excluding the deferred job
         
         >>> [CLI] bundle deploy --exclude jobs.deferred
        -Recreated internal_immutable_snapshots.immutable
        -Updated jobs.active
        -Files: 0 uploaded, 0 deleted
        -Resources: 1 created, 1 changed, 1 deleted, 0 unchanged, 1 not selected
        -OK: excluded job keeps its existing snapshot; active job uses the new one
        +Error: unknown flag: --exclude
         
        +Usage:
        +  databricks bundle deploy [flags]
        +
        +Flags:
        +      --auto-approve          Skip interactive approvals that might be required for deployment.
        +  -c, --cluster-id string     Override cluster in the deployment with the given cluster ID.
        +      --fail-on-active-runs   Fail if there are running jobs or pipelines in the deployment.
        +      --force                 Force-override Git branch validation.
        +      --force-lock            Force acquisition of deployment lock.
        +  -h, --help                  help for deploy
        +      --plan string           Path to a JSON plan file to apply instead of planning.
        +  -q, --quiet count           Reduce output: -q prints only the summary, -qq prints only warnings and errors.
        +      --select strings        Deploy only the specified resource (e.g. 'my_job' or 'jobs.my_job'). Can be repeated or comma-separated.
        +
        +Global Flags:
        +      --debug            enable debug logging
        +  -o, --output type      output type: text or json (default text)
        +  -p, --profile string   ~/.databrickscfg profile
        +  -t, --target string    bundle target to use (if applicable)
        +      --var strings      set values for variables defined in bundle config. Example: --var="foo=bar"
        +
        +
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
           delete resources.jobs.active
        @@ -25,3 +42,5 @@
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/exclude-immutable-[UNIQUE_NAME]/default
         
         Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.26.0): same output as main (8e70c8b)

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 8895de6

Run: 43443853073

Env 🔄​flaky 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 270 18 9:29
🔄​ aws-windows-latest-4core-16gb 1 1 271 16 8:18
💚​ azure linux-2core-8gb 1 269 18 13:15
💚​ azure-windows-latest-4core-16gb 1 271 16 8:23
💚​ gcp linux-2core-8gb 1 270 18 8:39
🔄​ gcp-windows-latest-4core-16gb 1 1 271 16 9:01
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🔄​ TestSyncFullFileSync ✅​p 🔄​f ✅​p ✅​p ✅​p 🔄​f
Top 12 slowest tests (at least 2 minutes):
duration env testname
4:20 azure linux-2core-8gb TestImportDir
3:39 azure-windows-latest-4core-16gb TestAccept
3:21 gcp-windows-latest-4core-16gb TestAccept
3:04 aws-windows-latest-4core-16gb TestAccept
2:56 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:53 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:45 aws-windows-latest-4core-16gb TestImportDir
2:44 gcp-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
2:39 gcp-windows-latest-4core-16gb TestFilerWorkspaceNotebook/rNb.r
2:35 azure linux-2core-8gb TestTelemetryEndpoint
2:23 azure-windows-latest-4core-16gb TestImportDirDoesNotOverwrite
2:14 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead

@lennartkats-db lennartkats-db added the ai-auto PRs made by AI loops & factories, label Nov 13, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-auto PRs made by AI loops & factories, DABs DABs related issues software-factory PR produced by the software factories task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add an --exclude flag for bundle resource deployment

2 participants