databricks-cli/libs/template
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
..
templates Fix DBConnect support in VS Code (#1253) 2024-03-05 14:31:27 +00:00
testdata Do not allow empty descriptions for bundle template inputs (#967) 2023-11-08 16:48:37 +00:00
config.go Add integration test for mlops-stacks initialization (#1155) 2024-03-12 14:15:54 +00:00
config_test.go Add support for `anyOf` to `skip_prompt_if` (#1133) 2024-01-25 10:09:42 +00:00
file.go Only treat files with .tmpl extension as templates (#594) 2023-08-01 13:43:27 +00:00
file_test.go Only treat files with .tmpl extension as templates (#594) 2023-08-01 13:43:27 +00:00
helpers.go Use UserName field to identify if service principal is used (#1310) 2024-03-25 11:32:45 +00:00
helpers_test.go Use Go SDK Iterators when listing resources with the CLI (#1202) 2024-02-21 14:16:36 +00:00
materialize.go Improve error message when path is not a bundle template (#985) 2023-11-22 12:25:16 +00:00
materialize_test.go Improve error message when path is not a bundle template (#985) 2023-11-22 12:25:16 +00:00
renderer.go Improve the output of the `databricks bundle init` command (#795) 2023-10-19 07:08:36 +00:00
renderer_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00