databricks-cli/internal/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
..
bundles Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
artifacts_test.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
basic_test.go Do CheckRunningResource only after terraform.Write (#1292) 2024-03-18 15:39:18 +00:00
bind_resource_test.go Added `bundle deployment bind` and `unbind` command (#1131) 2024-02-14 18:04:45 +00:00
deploy_then_remove_resources_test.go Use `acc.WorkspaceTest` helper from bundle integration tests (#1181) 2024-02-07 11:18:56 +00:00
deployment_state_test.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
empty_bundle_test.go Use `acc.WorkspaceTest` helper from bundle integration tests (#1181) 2024-02-07 11:18:56 +00:00
generate_job_test.go 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
generate_pipeline_test.go 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
helpers.go Do CheckRunningResource only after terraform.Write (#1292) 2024-03-18 15:39:18 +00:00
job_metadata_test.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
local_state_staleness_test.go Use `acc.WorkspaceTest` helper from bundle integration tests (#1181) 2024-02-07 11:18:56 +00:00
python_wheel_test.go Use `acc.WorkspaceTest` helper from bundle integration tests (#1181) 2024-02-07 11:18:56 +00:00