Skip to content
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

Fix locker unlock for destroy #492

Merged
merged 6 commits into from
Jun 19, 2023
Merged

Fix locker unlock for destroy #492

merged 6 commits into from
Jun 19, 2023

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Jun 16, 2023

Changes

Adds ability for allowing unlock to succeed even if the deploy file is missing.

Tests

Using integration tests and manually

@shreyas-goenka
Copy link
Contributor Author

Before:

shreyas.goenka@THW32HFW6T pipeline-progress % cli bundle destroy
Starting plan computation
Planning complete and persisted at /Users/shreyas.goenka/projects/pipeline-progress/.databricks/bundle/default/terraform/plan

No resources to destroy in plan. Skipping destroy!
Starting deletion of remote bundle files
Bundle remote directory is /Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default

/Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default and all files in it will be deleted permanently! Proceed?: y
Deleted snapshot file at /Users/shreyas.goenka/projects/pipeline-progress/.databricks/bundle/default/sync-snapshots/cbce15e6fb150777.json
Successfully deleted files!
Error: unlock called when lock is not held: no active lock on target dir: file does not exist: /Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default/state/deploy.lock

After:

shreyas.goenka@THW32HFW6T pipeline-progress % cli bundle destroy
Starting plan computation
Planning complete and persisted at /Users/shreyas.goenka/projects/pipeline-progress/.databricks/bundle/default/terraform/plan

No resources to destroy in plan. Skipping destroy!
Starting deletion of remote bundle files
Bundle remote directory is /Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default

/Users/shreyas.goenka@databricks.com/.bundle/pipeline-progress/default and all files in it will be deleted permanently! Proceed?: y
Deleted snapshot file at /Users/shreyas.goenka/projects/pipeline-progress/.databricks/bundle/default/sync-snapshots/cbce15e6fb150777.json
Successfully deleted files!

@shreyas-goenka
Copy link
Contributor Author

shreyas-goenka commented Jun 16, 2023

Integration tests pass on both windows and unix

Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

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

LGTM, bar the true/false argument.

libs/locker/locker.go Outdated Show resolved Hide resolved
@shreyas-goenka
Copy link
Contributor Author

integration tests are green

@shreyas-goenka shreyas-goenka merged commit 5d036ab into main Jun 19, 2023
4 checks passed
@shreyas-goenka shreyas-goenka deleted the fix-destroy-unlock branch June 19, 2023 13:57
@pietern pietern mentioned this pull request Jun 20, 2023
pietern added a commit that referenced this pull request Jun 20, 2023
## Changes

This version marks the first version available as public preview.

The minor bump to 200 better disambiguates between Databricks CLI "v1" (the Python version)
and this version, Databricks CLI "v2". The minor version of 0.100 may look lower than 0.17
to some, whereas 200 does not. This bump has no other significance.

CLI:
* Add filer.Filer implementation backed by the Files API ([#474](#474)).
* Add fs cp command ([#463](#463)).
* Correctly set ExactArgs if generated command has positional arguments ([#488](#488)).
* Do not use white color as string output ([#489](#489)).
* Update README to reflect public preview status ([#491](#491)).

Bundles:
* Fix force flag not working for bundle destroy ([#434](#434)).
* Fix locker unlock for destroy ([#492](#492)).
* Use better error assertions and clean up locker API ([#490](#490)).

Dependencies:
* Bump golang.org/x/mod from 0.10.0 to 0.11.0 ([#496](#496)).
* Bump golang.org/x/sync from 0.2.0 to 0.3.0 ([#495](#495)).
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.

None yet

2 participants