palantir / conjure-go-runtime

Go implementation of the Conjure runtime
Apache License 2.0
12 stars 22 forks source link

refactor: Update config, not params, during builder phase #694

Open bmoylan opened 3 weeks ago

bmoylan commented 3 weeks ago

This is a refactor to the internal logic of CGR and shouldn't have major user-facing implications. It allows for simplification of the code and some edge cases around error handling and refreshing to/from an invalid value.

Previously, the RefreshableClientConfig was mapped to a ValidatedClientParams and all provided functional client params modified that ValidatedClientParams. In this PR, we defer that mapping until after the client params have mutated the ClientConfig rather than the ValidatedClientParams. Delaying this mapping & the associated validation allows for invalid configuration to be overridden with valid params. It also allows for deleting a lot of conversion code since we can treat the ClientConfig as the "base" type during building.

Draft PR that requires the following pre-work PRs:


This change is Reviewable