databricks-cli/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
..
artifacts Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
config Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
deploy Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
deployer Fix locker unlock for destroy (#492) 2023-06-19 15:57:25 +02:00
env Consolidate environment variable interaction (#747) 2023-09-11 08:18:43 +00:00
internal Upgrade Terraform provider to 1.38.0 (#1308) 2024-03-25 09:17:52 +00:00
libraries Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
metadata Make `file_path` and `artifact_path` fields consistent with json tag (#987) 2023-11-15 13:37:26 +00:00
permissions Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
phases Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
python Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
run Add `--validate-only` flag to run validate-only pipeline update (#1251) 2024-03-04 08:38:32 +00:00
schema Update Go SDK to v0.36.0 (#1304) 2024-03-22 13:15:54 +00:00
scripts Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
tests Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
bundle.go Move folders package into libs (#1184) 2024-02-07 16:33:18 +00:00
bundle_test.go Add integration test for mlops-stacks initialization (#1155) 2024-03-12 14:15:54 +00:00
context.go Rename variable `bundle -> b` (#989) 2023-11-15 14:03:36 +00:00
context_test.go Add command that writes the materialized bundle configuration to stdout (#95) 2022-11-21 15:39:53 +01:00
deferred.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
deferred_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
log_string.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
mutator.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
mutator_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
root.go Move folders package into libs (#1184) 2024-02-07 16:33:18 +00:00
root_test.go Add integration test for mlops-stacks initialization (#1155) 2024-03-12 14:15:54 +00:00
seq.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
seq_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00