Skip to content

Support selecting resources for deletion with bundle deploy --select - #7023

Merged
andersrexdb merged 3 commits into
mainfrom
select-deletions
Oct 28, 2026
Merged

andersrexdb merged 3 commits into
mainfrom
select-deletions

Conversation

@andersrexdb

@andersrexdb andersrexdb commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Resolve --select selectors against the computed plan (Plan.FilterToSelected) instead of the config, so resources removed from config and planned for deletion can be selected like any other. The old ResolveSelect mutator is reduced to recording the select_used telemetry flag (renamed MarkSelectUsed).

When a selected resource is being deleted, the plan's closure follows reverse dependency edges: its dependents are deleted too so none are left dangling, while its own dependencies are left untouched — mirroring bundle destroy. A deployed selection still follows forward edges to pull in its dependencies. Grants and permissions sub-nodes move with their parent in both directions.

Deleting a resource whose dependent is still live (still in config, not itself being deleted) is an error before any API delete requests are sent. An invalid --select (a name in neither config nor state) is rejected before the predeploy script runs or any files are uploaded.

Tests

Added unit tests (TestFilterToSelected_*) and acceptance tests under acceptance/bundle/select.

This pull request and its description were written by Isaac.

@andersrexdb
andersrexdb requested review from a team as code owners October 12, 2026 12:40
@andersrexdb
andersrexdb requested a review from denik October 12, 2026 12:40
@github-actions github-actions Bot added the DABs DABs related issues label Oct 12, 2026
andersrexdb added a commit that referenced this pull request Oct 12, 2026
Add the trailing PR link required by the changelog validation so the
Changelog Preview workflow passes.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 4251876

Run: 40544081357

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 290 18 6:29
✅​ aws-windows-latest-4core-16gb 292 16 5:26
✅​ azure linux-2core-8gb 289 18 5:50
✅​ azure-windows-latest-4core-16gb 291 16 4:57
✅​ gcp linux-2core-8gb 290 18 6:44
✅​ gcp-windows-latest-4core-16gb 292 16 6:34
Top 6 slowest tests (at least 2 minutes):
duration env testname
5:03 gcp-windows-latest-4core-16gb TestAccept
4:08 aws-windows-latest-4core-16gb TestAccept
3:50 aws linux-2core-8gb TestAccept
3:40 azure-windows-latest-4core-16gb TestAccept
3:39 azure linux-2core-8gb TestAccept
3:33 gcp linux-2core-8gb TestAccept

Comment thread .nextchanges/bundles/select-deletions.md Outdated
Comment thread acceptance/bundle/select/deletion/script
Comment thread acceptance/bundle/select/deletion_dependents/output.txt
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 4251876f5 | Workflow run

Regression test report

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

12 tests: regression=6 unreleased=0 coverage=6 failing=0

test branch main (1ea9041) latest (v1.22.1)
TestAccept/bundle/select/deletion/DMS= ✅ ❌ ❌
TestAccept/bundle/select/deletion/DMS=true ✅ ❌ ❌
TestAccept/bundle/select/deletion_dependents/DMS= ✅ ❌ ❌
TestAccept/bundle/select/deletion_dependents/DMS=true ✅ ❌ ❌
TestAccept/bundle/select/deletion_saved_plan/DMS= ✅ ❌ ❌
TestAccept/bundle/select/deletion_saved_plan/DMS=true ✅ ❌ ❌
TestAccept/bundle/select/invalid_no_upload/DMS= ✅ ✅ ✅
TestAccept/bundle/select/invalid_no_upload/DMS=true ✅ ✅ ✅
TestAccept/bundle/select/missing/DMS= ✅ ✅ ✅
TestAccept/bundle/select/missing/DMS=true ✅ ✅ ✅
TestAccept/bundle/select/redeploy_unqualified/DMS= ✅ ✅ ✅
TestAccept/bundle/select/redeploy_unqualified/DMS=true ✅ ✅ ✅
TestAccept/bundle/select/deletion/DMS=: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion/output.txt
        +++ /tmp/TestAcceptbundleselectdeletionDMS=1190793618/002/output.txt
        @@ -9,68 +9,17 @@
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle plan --select jobs.gone
        -delete jobs.gone
        +Error: no such resource: jobs.gone
         
        -Plan: 0 to add, 0 to change, 1 to delete, 0 unchanged, 1 not selected
         
        -=== bundle deploy --select jobs.gone
        -
        ->>> [CLI] bundle deploy --select jobs.gone
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
        -=== Redeploy gone, then select it by unqualified name
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Created jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --select gone
        -delete jobs.gone
        -
        -Plan: 0 to add, 0 to change, 1 to delete, 0 unchanged, 1 not selected
        -
        -=== bundle deploy --select gone
        -
        ->>> [CLI] bundle deploy --select gone
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID_2]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.gone
           delete resources.jobs.keep
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (1ea9041)

TestAccept/bundle/select/deletion/DMS=true: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion/output.txt
        +++ /tmp/TestAcceptbundleselectdeletionDMS=true1455978115/002/output.txt
        @@ -9,68 +9,17 @@
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle plan --select jobs.gone
        -delete jobs.gone
        +Error: no such resource: jobs.gone
         
        -Plan: 0 to add, 0 to change, 1 to delete, 0 unchanged, 1 not selected
         
        -=== bundle deploy --select jobs.gone
        -
        ->>> [CLI] bundle deploy --select jobs.gone
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
        -=== Redeploy gone, then select it by unqualified name
        -
        ->>> [CLI] bundle deploy
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Created jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 0 deleted, 1 unchanged
        -
        ->>> [CLI] bundle plan --select gone
        -delete jobs.gone
        -
        -Plan: 0 to add, 0 to change, 1 to delete, 0 unchanged, 1 not selected
        -
        -=== bundle deploy --select gone
        -
        ->>> [CLI] bundle deploy --select gone
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID_2]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.gone
           delete resources.jobs.keep
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-del-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (1ea9041)

TestAccept/bundle/select/deletion_dependents/DMS=: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion_dependents/output.txt
        +++ /tmp/TestAcceptbundleselectdeletion_dependentsDMS=2075426350/002/output.txt
        @@ -10,14 +10,12 @@
         Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
         
         >>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
        -Files: 1 uploaded, 0 deleted
         
         >>> print_requests.py --sort //jobs/delete --keep
         
        @@ -28,44 +22,18 @@
         Plan: 0 to add, 1 to change, 1 to delete, 1 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -delete jobs.consumer
        -delete jobs.producer
        +Error: no such resource: jobs.producer
         
        -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged, 1 not selected
         
        -=== bundle deploy --select jobs.producer
        -
        ->>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Deleted jobs.consumer
        -Deleted jobs.producer
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 2 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [CONSUMER_ID]
        -  }
        -}
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [PRODUCER_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.consumer
           delete resources.jobs.keep
        +  delete resources.jobs.producer
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 3 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (1ea9041)

TestAccept/bundle/select/deletion_dependents/DMS=true: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion_dependents/output.txt
        +++ /tmp/TestAcceptbundleselectdeletion_dependentsDMS=true2398289176/002/output.txt
        @@ -10,14 +10,12 @@
         Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
         
         >>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
        -Files: 1 uploaded, 0 deleted
         
         >>> print_requests.py --sort //jobs/delete --keep
         
        @@ -28,44 +22,18 @@
         Plan: 0 to add, 1 to change, 1 to delete, 1 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -delete jobs.consumer
        -delete jobs.producer
        +Error: no such resource: jobs.producer
         
        -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged, 1 not selected
         
        -=== bundle deploy --select jobs.producer
        -
        ->>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Deleted jobs.consumer
        -Deleted jobs.producer
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 2 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [CONSUMER_ID]
        -  }
        -}
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [PRODUCER_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.consumer
           delete resources.jobs.keep
        +  delete resources.jobs.producer
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 3 deleted
        +
        +Exit code: 1

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion_dependents/output.txt
        +++ /tmp/TestAcceptbundleselectdeletion_dependentsDMS=true2307865809/002/output.txt
        @@ -10,14 +10,12 @@
         Resources: 3 created, 0 changed, 0 deleted, 0 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
         
         >>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Error: cannot delete jobs.producer: jobs.consumer still references it; remove the reference or also remove jobs.consumer from the config
        +Error: no such resource: jobs.producer
         
        -Files: 1 uploaded, 0 deleted
         
         >>> print_requests.py --sort //jobs/delete --keep
         
        @@ -28,44 +22,18 @@
         Plan: 0 to add, 1 to change, 1 to delete, 1 unchanged
         
         >>> [CLI] bundle plan --select jobs.producer
        -delete jobs.consumer
        -delete jobs.producer
        +Error: no such resource: jobs.producer
         
        -Plan: 0 to add, 0 to change, 2 to delete, 0 unchanged, 1 not selected
         
        -=== bundle deploy --select jobs.producer
        -
        ->>> [CLI] bundle deploy --select jobs.producer
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default/files...
        -Deleted jobs.consumer
        -Deleted jobs.producer
        -Files: 1 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 2 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [CONSUMER_ID]
        -  }
        -}
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [PRODUCER_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.consumer
           delete resources.jobs.keep
        +  delete resources.jobs.producer
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-deldep-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 3 deleted
        +
        +Exit code: 1
        
FAIL
TestAccept/bundle/select/deletion_saved_plan/DMS=: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion_saved_plan/output.txt
        +++ /tmp/TestAcceptbundleselectdeletion_saved_planDMS=2601687733/002/output.txt
        @@ -7,32 +7,17 @@
         Created jobs.keep
         Files: 3 uploaded, 0 deleted
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        +Error: no such resource: jobs.gone
         
        -=== bundle deploy --plan (no --select)
         
        ->>> [CLI] bundle deploy --plan plan.json
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-plan-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.gone
           delete resources.jobs.keep
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-del-plan-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (1ea9041)

TestAccept/bundle/select/deletion_saved_plan/DMS=true: branch ✅ | main (1ea9041) ❌ | latest (v1.22.1) ❌

main (1ea9041):

acceptance_test.go:1341: Diff:
        --- bundle/select/deletion_saved_plan/output.txt
        +++ /tmp/TestAcceptbundleselectdeletion_saved_planDMS=true2332144492/002/output.txt
        @@ -7,32 +7,17 @@
         Created jobs.keep
         Files: 3 uploaded, 0 deleted
         Resources: 2 created, 0 changed, 0 deleted, 0 unchanged
        +Error: no such resource: jobs.gone
         
        -=== bundle deploy --plan (no --select)
         
        ->>> [CLI] bundle deploy --plan plan.json
        -Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/select-del-plan-[UNIQUE_NAME]/default/files...
        -Deleted jobs.gone
        -Files: 2 uploaded, 0 deleted
        -Resources: 0 created, 0 changed, 1 deleted, 0 unchanged, 1 not selected
        -
        ->>> print_requests.py --sort //jobs/delete
        -{
        -  "method": "POST",
        -  "path": "/api/2.2/jobs/delete",
        -  "body": {
        -    "job_id": [GONE_ID]
        -  }
        -}
        -
        ->>> [CLI] bundle plan
        -Plan: 0 to add, 0 to change, 0 to delete, 1 unchanged
        -
         === Destroy
         >>> [CLI] bundle destroy --auto-approve
         The following resources will be deleted:
        +  delete resources.jobs.gone
           delete resources.jobs.keep
         
         All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/select-del-plan-[UNIQUE_NAME]/default
         
        -Destroy: 1 deleted
        +Destroy: 2 deleted
        +
        +Exit code: 1

latest (v1.22.1): same output as main (1ea9041)

@andersrexdb
andersrexdb requested a review from denik October 21, 2026 08:20
Comment thread bundle/deployplan/plan.go Outdated
andersrexdb and others added 3 commits October 27, 2026 18:41
Resolve --select selectors against the computed plan (Plan.FilterToSelected)
instead of the config, so resources removed from config and planned for deletion
can be selected like any other. The old ResolveSelect mutator is reduced to
recording the select_used telemetry flag (renamed MarkSelectUsed).

When a selected resource is being deleted, the plan's closure follows reverse
dependency edges: its dependents are deleted too so none are left dangling, while
its own dependencies are left untouched — mirroring bundle destroy. A deployed
selection still follows forward edges to pull in its dependencies. Grants and
permissions sub-nodes move with their parent in both directions.

Deleting a resource whose dependent is still live (still in config, not itself
being deleted) is an error before any API delete requests are sent. An invalid
--select (a name in neither config nor state) is rejected before the predeploy
script runs or any files are uploaded.

When --plan is used alongside a --select that doesn't match the selectors the
plan was built with, a warning is emitted. The plan serializes was_filtered and
selectors so a pre-filtered plan file can be passed to bundle deploy --plan
without re-specifying --select.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Remove the WasFiltered and Selectors plan fields and the --plan + --select
warning they supported, per review: --plan keeps ignoring --select as before,
and encoding the selection in the plan is left for a follow-up.

Stop sorting the delete requests in the deletion_dependents acceptance test.
--sort orders by raw job ID, which is random on a real workspace and made the
test flaky in cloud runs; dependents are deleted first, so the order is stable.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread bundle/deployplan/plan.go
// e.g. "jobs.my_job") plus their transitive dependencies as recorded in each
// entry's DependsOn field. Nodes not reachable from the selected set are removed.
func (p *Plan) FilterToSelected(selected []string) {
// ResolveSelectors maps each --select selector to its plan key ("resources.type.name")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be minor overlap with ResolveKey https://github.com/databricks/cli/pull/7128/changes

maybe we should rewrite ResolveKey users to use this function (not required, just an idea).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That true, but ResolveKey returns the config object and can't see state-only deletions, so I'd keep them separate here and maybe address in follow-up.

@andersrexdb
andersrexdb added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 3909f85 Oct 28, 2026
28 checks passed
@andersrexdb
andersrexdb deleted the select-deletions branch October 28, 2026 10:47
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 3909f85

Run: 40675025230

Env 🔄​flaky ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 6 1470 1219 174:18
✅​ aws-windows-latest-4core-16gb 1401 1244 185:05
🔄​ azure linux-2core-8gb 4 1321 1271 150:02
✅​ azure-windows-latest-4core-16gb 1250 1296 141:23
🔄​ gcp linux-2core-8gb 3 1309 1276 151:53
🔄​ gcp-windows-latest-4core-16gb 3 1234 1301 172:41
12 interesting tests: 12 flaky
Test Name aws linux-2core-8gb azure linux-2core-8gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
🔄​ TestAccept ✅​p ✅​p 🔄​f 🔄​f
🔄​ TestAccept/bundle/config-remote-sync/multiple_resources ✅​p 🔄​f ✅​p 🙈​s
🔄​ TestAccept/bundle/config-remote-sync/multiple_resources/DMS= ✅​p 🔄​f ✅​p
🔄​ TestAccept/bundle/invariant/destroy_idempotent 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/invariant/destroy_idempotent/DMS=/INPUT_CONFIG=instance_pool.yml.tmpl/READPLAN= 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/invariant/no_drift 🔄​f ✅​p 🔄​f ✅​p
🔄​ TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=genie_space.yml.tmpl/READPLAN= 🔄​f ✅​p ✅​p ✅​p
🔄​ TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=genie_space.yml.tmpl/READPLAN= ✅​p ✅​p 🔄​f ✅​p
🔄​ TestAccept/bundle/resources/apps/lifecycle-started ✅​p 🔄​f ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/apps/lifecycle-started/DMS= ✅​p 🔄​f ✅​p 🔄​f
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate 🔄​f 🙈​s 🙈​s 🙈​s
🔄​ TestAccept/bundle/resources/postgres_synced_tables/recreate/DMS= 🔄​f
Top 50 slowest tests (at least 2 minutes):
duration env testname
14:57 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
10:34 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
10:33 azure linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
9:21 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
9:15 aws linux-2core-8gb TestAccept/bundle/deploy/spark-jar-task/DMS=true
8:58 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=1
8:55 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
8:46 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
8:26 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
8:11 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
8:09 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
8:04 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
8:03 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
8:00 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
7:57 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
7:48 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster.yml.tmpl/READPLAN=
7:45 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/delete_idempotent/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
7:42 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
7:41 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:40 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:33 gcp linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
7:27 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
7:24 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
7:22 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
7:22 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
7:20 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:20 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:18 aws-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
7:18 aws linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:17 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=
7:17 azure-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=true
7:12 aws-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
7:11 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=1
7:09 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=true
7:08 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
7:03 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_apply_policy_default_values.yml.tmpl/READPLAN=
6:59 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
6:58 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=
6:56 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/deploy/local_ssd_count/DMS=true
6:47 aws-windows-latest-4core-16gb TestAccept/bundle/invariant/no_drift/DMS=true/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=
6:40 aws linux-2core-8gb TestAccept/bundle/invariant/no_drift/DMS=/INPUT_CONFIG=cluster_libraries.yml.tmpl/READPLAN=1
6:39 gcp linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
6:36 aws linux-2core-8gb TestAccept/bundle/config-remote-sync/multiple_resources/DMS=
6:27 azure linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
6:15 gcp linux-2core-8gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
5:49 azure linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true
5:43 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=
5:39 aws linux-2core-8gb TestAccept/bundle/resources/clusters/lifecycle-started-toggle/DMS=true
5:38 gcp-windows-latest-4core-16gb TestAccept/bundle/resources/apps/lifecycle-started/DMS=
5:35 azure-windows-latest-4core-16gb TestAccept/bundle/resources/clusters/lifecycle-started/DMS=true

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

Labels

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants