databricks-cli/bundle/phases
Pieter Noordhuis ed194668db
Return `diag.Diagnostics` from mutators (#1305)
## Changes

This diagnostics type allows us to capture multiple warnings as well as
errors in the return value. This is a preparation for returning
additional warnings from mutators in case we detect non-fatal problems.

* All return statements that previously returned an error now return
`diag.FromErr`
* All return statements that previously returned `fmt.Errorf` now return
`diag.Errorf`
* All `err != nil` checks now use `diags.HasError()` or `diags.Error()`

## Tests

* Existing tests pass.
* I confirmed no call site under `./bundle` or `./cmd/bundle` uses
`errors.Is` on the return value from mutators. This is relevant because
we cannot wrap errors with `%w` when calling `diag.Errorf` (like
`fmt.Errorf`; context in https://github.com/golang/go/issues/47641).
2024-03-25 14:18:47 +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 Push deployment state right after files upload (#1293) 2024-03-19 09:47:41 +00:00
destroy.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
initialize.go Filter current user from resource permissions (#1262) 2024-03-11 15:05:15 +00:00
phase.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00