Uh oh!
There was an error while loading. Please reload this page.
Move to a single prompt during bundle destroy - #1583
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Core destructive mutators for destroy. These require informed user consent. | ||
| destroyCore := bundle.Seq( | ||
| terraform.Destroy(), | ||
| terraform.StatePush(), |
There was a problem hiding this comment.
(not blocking because it's the same as it was) Why do we push an empty state prior to deleting it?
There was a problem hiding this comment.
It seems related to keeping the state consistent before deleting files, to be robust against errors, before we delete root_path.
We used to release the lock before calling files.Delete(). I think it's okay to remove this, will send a followup PR.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
pietern
commented
Jul 23, 2024
Thanks, LGTM. @andrewnester Could you review as well? |
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
## Changes Following up #1583 (comment). We can skip pushing because right after `root_path` is deleted, making this a no-op effectively. ## Tests
## Changes Right now we ask users for two confirmations when destroying a bundle. One to destroy the resources and one to delete the files. This PR consolidates the two prompts into one. ## Tests Manually Destroying a bundle with no resources: ``` ➜ bundle-playground git:(master) ✗ cli bundle destroy All files and directories at the following location will be deleted: /Users/shreyas.goenka@databricks.com/.bundle/bundle-playground/default Would you like to proceed? [y/n]: y No resources to destroy Updating deployment state... Deleting files... Destroy complete! ``` Destroying a bundle with no remote state: ``` ➜ bundle-playground git:(master) ✗ cli bundle destroy No active deployment found to destroy! ``` When a user cancells a deployment: ``` ➜ bundle-playground git:(master) ✗ cli bundle destroy The following resources will be deleted: delete job job_1 delete job job_2 delete pipeline foo All files and directories at the following location will be deleted: /Users/shreyas.goenka@databricks.com/.bundle/bundle-playground/default Would you like to proceed? [y/n]: n Destroy cancelled! ``` When a user destroys resources: ``` ➜ bundle-playground git:(master) ✗ cli bundle destroy The following resources will be deleted: delete job job_1 delete job job_2 delete pipeline foo All files and directories at the following location will be deleted: /Users/shreyas.goenka@databricks.com/.bundle/bundle-playground/default Would you like to proceed? [y/n]: y Updating deployment state... Deleting files... Destroy complete! ```
Bundles: * Add UUID function to bundle template functions ([#1612](#1612)). * Upgrade TF provider to 1.49.0 ([#1617](#1617)). * Upgrade TF provider to 1.49.1 ([#1626](#1626)). * Support multiple locations for diagnostics ([#1610](#1610)). * Split artifact cleanup into prepare step before build ([#1618](#1618)). * Move to a single prompt during bundle destroy ([#1583](#1583)). Internal: * Add tests for the Workspace API readahead cache ([#1605](#1605)). * Update Python dependencies before install when upgrading a labs project ([#1624](#1624)).
## Changes Following up #1583 (comment). We can skip pushing because right after `root_path` is deleted, making this a no-op effectively. ## Tests
Changes
Right now we ask users for two confirmations when destroying a bundle. One to destroy the resources and one to delete the files. This PR consolidates the two prompts into one.
Tests
Manually
Destroying a bundle with no resources:
Destroying a bundle with no remote state:
When a user cancells a deployment:
When a user destroys resources: