databricks-cli/libs/config
Pieter Noordhuis 2c908f8fea
Function to convert Go struct back to `config.Value` (#935)
## Changes

This PR is the counterpart to #904. With this change, we are able to
convert a `config.Value` into a Go struct, make modifications to the Go
struct, and reflect those changes in a new `config.Value`.

This functionality allows us to incrementally introduce this
configuration representation to existing bundle mutators. Bundle
mutators expect a `*bundle.Bundle` argument and mutate its configuration
directly. These mutations are not reflected in the corresponding
`config.Value` (once introduced), which means we cannot use the
`config.Value` as source of truth until we update _all_ mutators. To
address this, we can run `convert.ToTyped` and `convert.FromTyped` at
the mutator boundary (from `bundle.Apply`) and capture changes made to
the Go struct. Then we can incrementally make mutators aware of the
`config.Value` configuration and have them mutate that structure
directly.

## Tests

New unit tests pass.

Manual spot checks against the bundle configuration type.
2023-11-15 09:19:51 +00:00
..
convert Function to convert Go struct back to `config.Value` (#935) 2023-11-15 09:19:51 +00:00
merge Function to merge two instances of `config.Value` (#938) 2023-11-03 19:15:47 +00:00
yamlloader Loading an empty file yields a nil (#906) 2023-10-24 11:24:43 +00:00
kind.go Library to convert config.Value to Go struct (#904) 2023-10-24 11:12:36 +00:00
location.go New YAML loader to support configuration location (#828) 2023-10-20 12:56:59 +00:00
location_test.go New YAML loader to support configuration location (#828) 2023-10-20 12:56:59 +00:00
value.go Library to convert config.Value to Go struct (#904) 2023-10-24 11:12:36 +00:00
value_test.go New YAML loader to support configuration location (#828) 2023-10-20 12:56:59 +00:00