Skip to content

Allow configuring cascade deletion in DABs#5846

Open
ronaldz-db wants to merge 3 commits into
databricks:mainfrom
ronaldz-db:pipelines-destroy-cascade
Open

Allow configuring cascade deletion in DABs#5846
ronaldz-db wants to merge 3 commits into
databricks:mainfrom
ronaldz-db:pipelines-destroy-cascade

Conversation

@ronaldz-db

@ronaldz-db ronaldz-db commented Jul 8, 2026

Copy link
Copy Markdown

Changes

Add a cascade field to the pipeline bundle resource that controls whether destroying a pipeline also cascades to its datasets. When unset, we maintain the existing default of true.

This change applies to the direct engine. We have a separate change on the Terraform side: databricks/terraform-provider-databricks#5860

Why

Previously, pipeline deletion would automatically cascade to its tables. After user feedback, we decided to make this configurable in the DeletePipeline API. This extends support to DABs as well, which was another common user ask.

Tests

Unit tests

Add a `cascade` field to the pipeline bundle resource that controls whether
destroying a pipeline also deletes its datasets (materialized views, streaming
tables, and views). When unset, the server default applies (cascade); set
`cascade: false` to retain the datasets on destroy.

The field is delete-time only: it is not part of the pipeline spec, so it is
never sent on create/update. The direct engine persists it in state (via a
PipelineState wrapper around CreatePipeline, mirroring the sql_warehouse
lifecycle pattern) and reads it at delete time, force-sending cascade so an
explicit false survives query-string omitempty (honored for query params as of
databricks-sdk-go v0.152.0). A cascade-only change is a state-only update with
no pipeline API call. cascade is classified input_only so it does not show
remote drift.

The terraform engine drops the field for now: the pinned provider has no such
attribute yet (pending terraform-provider-databricks#5860), so terraform-engine
support is a follow-up.

Co-authored-by: Isaac
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

29 files changed
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @andrewnester, @shreyas-goenka, @lennartkats-db, @anton-107

/acceptance/pipelines/ - needs approval

14 files changed
Suggested: @lennartkats-db
Also eligible: @kanterov, @jefferycheng1

/bundle/ - needs approval

11 files changed
Suggested: @denik
Also eligible: @pietern, @janniklasrose, @andrewnester, @shreyas-goenka, @lennartkats-db, @anton-107

General files (require maintainer)

Files: .vscode/settings.json, NEXT_CHANGELOG.md
Based on git history:

  • @denik -- recent work in bundle/direct/dresources/, bundle/phases/, bundle/config/mutator/

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose) can approve all areas.
See OWNERS for ownership rules.

Comment thread bundle/direct/dresources/pipeline.go
Comment thread acceptance/pipelines/destroy/destroy-pipeline-cascade/databricks.yml Outdated
Comment thread acceptance/pipelines/destroy/destroy-pipeline-cascade/output.txt
pipelines:
my_pipeline:
name: test-pipeline-cascade
cascade: false

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.

Could you make sure the default template also sets purge_on_destroy: false? With a very short comment to the side explaining it? Could be a separate PR.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ack will put this change in a follow-up PR.

Comment thread acceptance/pipelines/destroy/destroy-pipeline-cascade/test.toml Outdated
… message fix

- Rename the pipeline config field cascade -> cascade_on_destroy, matching the
  Lakebase purge_on_delete precedent (per review discussion).
- Add ValidateCascadeOnDestroy mutator: hard error when the field is used with
  the terraform engine, which does not support it yet.
- Fix the destroy approval message so a pipeline with cascade_on_destroy: false
  is not described as deleting its STs/MVs, and mention the property otherwise.
- Comment why ForceSendFields is needed in DoDelete.
- Regenerate schema, refschema, and affected acceptance outputs.

Co-authored-by: Isaac
@github-actions

Copy link
Copy Markdown
Contributor

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 5846
  • Commit SHA: 9a2436c214c1d29cb3da86d8ed1db627f69d651b

Checks will be approved automatically on success.

Comment thread acceptance/pipelines/destroy/destroy-pipeline-cascade/output.txt
Comment thread bundle/phases/destroy.go
Comment thread acceptance/pipelines/destroy/destroy-pipeline-cascade/databricks.yml Outdated
pipelines:
my_pipeline:
name: test-pipeline-cascade
cascade: false

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

ack will put this change in a follow-up PR.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants