databricks-cli/bundle/deploy
Pieter Noordhuis 446a9d0c52
Properly deal with nil values in `convert.FromTyped` (#1511)
## Changes

When a configuration defines:
```yaml
run_as:
```

It first showed up as `run_as -> nil` in the dynamic configuration only
to later be converted to `run_as -> {}` while going through typed
conversion. We were using the presence of a key to initialize an empty
value. This is incorrect and it should have remained a nil value.

This conversion was happening in `convert.FromTyped` where any struct
always returned a map value. Instead, it should only return a map value
in any one of these cases: 1) the struct has elements, 2) the struct was
originally a map in the dynamic configuration, or 3) the struct was
initialized to a non-empty pointer value.

Stacked on top of #1516 and #1518.

## Tests

* Unit tests pass.
* Integration tests pass.
* Manually ran through bundle CRUD with a bundle without resources.
2024-06-21 13:43:21 +00:00
..
files Avoid multiple file tree traversals on bundle deploy (#1493) 2024-06-17 09:48:52 +00:00
lock Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
metadata Annotate DLT pipelines when deployed using DABs (#1410) 2024-05-01 08:37:03 +00:00
terraform Properly deal with nil values in `convert.FromTyped` (#1511) 2024-06-21 13:43:21 +00:00
filer.go Added deployment state for bundles (#1267) 2024-03-18 14:41:58 +00:00
state.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
state_pull.go Added validate mutator to surface additional bundle warnings (#1352) 2024-04-18 15:13:16 +00:00
state_pull_test.go Update error checks that use the `os` package to use `errors.Is` (#1461) 2024-06-03 12:39:36 +00:00
state_push.go Return `diag.Diagnostics` from mutators (#1305) 2024-03-25 14:18:47 +00:00
state_push_test.go Move path field to bundle type (#1316) 2024-03-27 09:03:24 +00:00
state_test.go Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
state_update.go Avoid multiple file tree traversals on bundle deploy (#1493) 2024-06-17 09:48:52 +00:00
state_update_test.go Avoid multiple file tree traversals on bundle deploy (#1493) 2024-06-17 09:48:52 +00:00