databricks-cli/cmd
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
..
account Update Go SDK to v0.36.0 (#1304) 2024-03-22 13:15:54 +00:00
api Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
auth Ignore environment variables for `auth profiles` (#1189) 2024-02-08 12:25:51 +00:00
bundle Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
configure Filter out system clusters for `--configure-cluster` (#1031) 2023-11-30 09:59:11 +00:00
fs Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
labs Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
root Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
sync Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
version Add usage string when command fails with incorrect arguments (#1276) 2024-03-12 14:12:34 +00:00
workspace Update Go SDK to v0.36.0 (#1304) 2024-03-22 13:15:54 +00:00
cmd.go Add `databricks labs` command group (#914) 2023-11-17 12:47:37 +00:00