Repository navigation
acc: record that a rejected delete drops the resource from state in bundle/destroy/delete-error #7930
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
Merged
Merged
acc: record that a rejected delete drops the resource from state in bundle/destroy/delete-error #7930
Changes from all commits
Commits
Show all changes
3 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| bundle: | ||
| name: delete-error-$UNIQUE_NAME | ||
|
|
||
| resources: | ||
| jobs: | ||
| foo: | ||
| name: foo-$UNIQUE_NAME | ||
| bar: | ||
| name: bar-$UNIQUE_NAME |
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,2 @@ | ||
| Cloud = false | ||
| EnvMatrix.DMS = [] |
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,36 @@ | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/delete-error-[UNIQUE_NAME]/default/files... | ||
| Created jobs.bar | ||
| Created jobs.foo | ||
| Files: 2 uploaded, 0 deleted | ||
| Resources: 2 created, 0 changed, 0 deleted, 0 unchanged | ||
|
|
||
| === deploy: removing bar from config, its delete is rejected with 400 | ||
|
|
||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/delete-error-[UNIQUE_NAME]/default/files... | ||
| Deleted jobs.bar | ||
| Files: 1 uploaded, 0 deleted | ||
| Resources: 0 created, 0 changed, 1 deleted, 1 unchanged | ||
|
|
||
| >>> [CLI] jobs get [BAR_ID] | ||
| json.settings.name = "bar-[UNIQUE_NAME]"; | ||
|
|
||
| >>> print_state.py | ||
| json.state.resources.jobs.foo.__id__ = "[FOO_ID]"; | ||
|
|
||
| === destroy: the delete of foo is rejected with 400 | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.jobs.foo | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/delete-error-[UNIQUE_NAME]/default | ||
|
|
||
| Destroy: 1 deleted | ||
|
|
||
| >>> [CLI] jobs get [FOO_ID] | ||
| json.settings.name = "foo-[UNIQUE_NAME]"; | ||
|
|
||
| >>> find.py \.databricks/.*resources.*\.json |
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,19 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
| trace $CLI bundle deploy | ||
| foo_id=$(read_id.py foo) | ||
| bar_id=$(read_id.py bar) | ||
|
|
||
| title "deploy: removing bar from config, its delete is rejected with 400" | ||
| update_file.py databricks.yml " bar: | ||
| name: bar-$UNIQUE_NAME | ||
| " "" | ||
| fault.py "POST /api/2.2/jobs/delete" 400 0 1 INVALID_PARAMETER_VALUE | ||
| errcode trace $CLI bundle deploy | ||
| trace $CLI jobs get $bar_id | gron.py | grep settings.name | ||
| trace print_state.py | gron.py | grep __id__ | ||
|
|
||
| title "destroy: the delete of foo is rejected with 400" | ||
| fault.py --body-contains "\"job_id\":$foo_id}" "POST /api/2.2/jobs/delete" 400 0 1 INVALID_PARAMETER_VALUE | ||
| errcode trace $CLI bundle destroy --auto-approve | ||
| trace $CLI jobs get $foo_id | gron.py | grep settings.name | ||
| trace find.py '\.databricks/.*resources.*\.json' | ||
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,4 @@ | ||
| Badness = "When the backend rejects a delete and a re-read does not confirm the resource is gone, deploy and destroy drop the resource from state and succeed, so the job stays in the workspace untracked. They should fail with the delete error and keep the resource in state, as the DMS=true run does." | ||
|
|
||
| # The DMS=true run already fails on the rejected delete, so it is excluded until both agree. | ||
| EnvMatrix.DMS = [] |
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.