databricks-cli/bundle/deploy
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
..
files Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
lock Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
metadata Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
terraform Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
check_running_resources.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
check_running_resources_test.go Added warning when trying to deploy bundle with `--fail-if-running` and running resources (#1163) 2024-02-07 11:17:17 +00:00
filer.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state_pull.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_pull_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_push.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_push_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_test.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state_update.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_update_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00