databricks-cli/bundle/config
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
..
generate Added `bundle generate pipeline` command (#1139) 2024-01-25 11:35:14 +00:00
loader Return diagnostics from `config.Load` (#1324) 2024-03-28 10:59:03 +00:00
mutator Properly deal with nil values in `convert.FromTyped` (#1511) 2024-06-21 13:43:21 +00:00
paths Remove dependency on `ConfigFilePath` from path translation mutator (#1437) 2024-05-17 09:26:09 +00:00
resources Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
testdata First look for databricks.yml before falling back to bundle.yml (#580) 2023-07-18 12:16:34 +02:00
validate Abstract over filesystem interaction with libs/vfs (#1452) 2024-05-30 07:41:50 +00:00
variable Return `application_id` for service principal lookups (#1245) 2024-03-04 16:12:10 +00:00
artifact.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
artifacts_test.go Added exec.NewCommandExecutor to execute commands with correct interpreter (#1075) 2023-12-21 15:45:23 +00:00
bundle.go Allow specifying CLI version constraints required to run the bundle (#1320) 2024-04-02 12:55:21 +00:00
deployment.go Disable locking for development mode (#1302) 2024-04-18 01:59:39 +00:00
experimental.go Add ApplyPythonMutator (#1430) 2024-06-20 08:43:08 +00:00
filename.go Move bundle configuration filename code (#917) 2023-10-25 09:54:39 +00:00
filename_test.go Move bundle configuration filename code (#917) 2023-10-25 09:54:39 +00:00
git.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
lock.go Disable locking for development mode (#1302) 2024-04-18 01:59:39 +00:00
lock_test.go Acquire lock prior to deploy (#270) 2023-03-22 16:37:26 +01:00
resources.go Add support for Lakehouse monitoring in bundles (#1307) 2024-05-31 09:42:25 +00:00
resources_test.go Assert customer marshalling is implemented for resources (#1425) 2024-05-14 10:30:48 +00:00
root.go Add ApplyPythonMutator (#1430) 2024-06-20 08:43:08 +00:00
root_test.go Return diagnostics from `config.Load` (#1324) 2024-03-28 10:59:03 +00:00
sync.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
target.go Use dynamic configuration model in bundles (#1098) 2024-02-16 19:41:58 +00:00
workspace.go Added `auth describe` command (#1244) 2024-04-03 08:14:04 +00:00
workspace_test.go Resolve configuration before performing verification (#890) 2023-10-20 13:10:31 +00:00