databricks-cli/bundle/phases
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
..
bind.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
build.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
deploy.go Don't merge-in remote resources during depolyments (#1432) 2024-05-15 12:41:44 +00:00
destroy.go Return early in bundle destroy if no deployment exists (#1581) 2024-07-09 15:08:38 +00:00
initialize.go Replace `vfs.Path` with extension-aware filer when running on DBR (#1556) 2024-07-03 11:55:42 +00:00
load.go Load bundle configuration from mutator (#1318) 2024-03-27 10:49:05 +00:00
phase.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00