databricks-cli/bundle/python
shreyas-goenka 5bc5c3c26a
Return early in bundle destroy if no deployment exists (#1581)
## Changes
This PR:
1. Moves the if mutator to the bundle package, to live with all-time
greats such as `bundle.Seq` and `bundle.Defer`. Also adds unit tests.
2. `bundle destroy` now returns early if `root_path` does not exist. We
do this by leveraging a `bundle.If` condition.

## Tests
Unit tests and manually.

Here's an example of what it'll look like once the bundle is destroyed.

```
➜  bundle-playground git:(master) ✗ cli bundle destroy
No active deployment found to destroy!
```

I would have added some e2e coverage for this as well, but the
`cobraTestRunner.Run()` method does not seem to return stdout/stderr
logs correctly. We can probably punt looking into it.
2024-07-09 15:08:38 +00:00
..
conditional_transform_test.go Move path field to bundle type (#1316) 2024-03-27 09:03:24 +00:00
transform.go Return early in bundle destroy if no deployment exists (#1581) 2024-07-09 15:08:38 +00:00
transform_test.go Move path field to bundle type (#1316) 2024-03-27 09:03:24 +00:00
warning.go Show a better error message for using wheel tasks with older DBR versions (#1373) 2024-04-23 19:36:25 +00:00
warning_test.go Show a better error message for using wheel tasks with older DBR versions (#1373) 2024-04-23 19:36:25 +00:00