databricks-cli/cmd/bundle
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
..
deployment Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
generate Generate correct YAML if custom_tags or spark_conf is used for pipeline or job cluster configuration (#1210) 2024-02-15 15:03:19 +00:00
utils Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
bundle.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
deploy.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
destroy.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
generate.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
init.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
init_test.go Improve experience for multiple builtin templates (#1052) 2023-12-27 12:03:08 +00:00
launch.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
run.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
schema.go Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
summary.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
sync.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
test.go Remove dependency on global state for remaining commands (#613) 2023-07-27 10:03:08 +00:00
validate.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
variables.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00