-
Notifications
You must be signed in to change notification settings - Fork 195
test-only: Add cascade field to pipeline resource for destroy #5874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewnester
wants to merge
2
commits into
main
Choose a base branch
from
test/ronaldz-db/pipelines-destroy-cascade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
acceptance/pipelines/destroy/destroy-pipeline-cascade/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| bundle: | ||
| name: test-pipeline-destroy-cascade | ||
| resources: | ||
| pipelines: | ||
| my_pipeline: | ||
| name: test-pipeline-cascade | ||
| cascade: false |
3 changes: 3 additions & 0 deletions
3
acceptance/pipelines/destroy/destroy-pipeline-cascade/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
acceptance/pipelines/destroy/destroy-pipeline-cascade/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
|
|
||
| === Deploy a pipeline configured with cascade: false | ||
| >>> [CLI] pipelines deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?w=[NUMID] | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/pipelines", | ||
| "body": { | ||
| "channel": "CURRENT", | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/state/metadata.json" | ||
| }, | ||
| "edition": "ADVANCED", | ||
| "name": "test-pipeline-cascade" | ||
| } | ||
| } | ||
|
|
||
| === Change only cascade (false -> true): expect a state-only update, no pipeline update API call | ||
| >>> [CLI] pipelines deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| View your pipeline my_pipeline here: [DATABRICKS_URL]/pipelines/[UUID]?w=[NUMID] | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
|
|
||
| === Destroy: delete reads the updated cascade=true from persisted state | ||
| >>> [CLI] pipelines destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.pipelines.my_pipeline | ||
|
|
||
| This action will result in the deletion of the following Lakeflow Spark Declarative Pipelines along with the | ||
| Streaming Tables (STs) and Materialized Views (MVs) managed by them: | ||
| delete resources.pipelines.my_pipeline | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-pipeline-destroy-cascade/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! | ||
|
|
||
| >>> print_requests.py //api/2.0/pipelines | ||
| { | ||
| "method": "DELETE", | ||
| "path": "/api/2.0/pipelines/[UUID]", | ||
| "q": { | ||
| "cascade": "true" | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
acceptance/pipelines/destroy/destroy-pipeline-cascade/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| title "Deploy a pipeline configured with cascade: false" | ||
| trace $CLI pipelines deploy | ||
|
|
||
| # Flush the deploy requests: cascade is delete-time-only, so the create request must not carry it. | ||
| trace print_requests.py //api/2.0/pipelines | ||
|
|
||
| title "Change only cascade (false -> true): expect a state-only update, no pipeline update API call" | ||
| update_file.py databricks.yml "cascade: false" "cascade: true" | ||
| trace $CLI pipelines deploy | ||
| # No POST/PATCH to /pipelines is expected here; the cascade-only change is persisted to state. | ||
| trace print_requests.py //api/2.0/pipelines | ||
|
|
||
| title "Destroy: delete reads the updated cascade=true from persisted state" | ||
| trace $CLI pipelines destroy --auto-approve | ||
| trace print_requests.py //api/2.0/pipelines |
5 changes: 5 additions & 0 deletions
5
acceptance/pipelines/destroy/destroy-pipeline-cascade/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # --cascade only affects the direct engine's delete request; the terraform engine deletes | ||
| # pipelines through the provider and ignores it. Restrict to direct so the recorded request | ||
| # is meaningful and the single variant does not diverge. | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
| RecordRequests = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.