Draft
Conversation
5578788 to
da59cf3
Compare
This is a significant change because in v0.16.0, the `types` package changed such that values are immutable and the internal state is now unexported.
da59cf3 to
ae38248
Compare
hugoShaka
reviewed
Mar 18, 2025
| f.ValueToMethod = o.ValueToMethod | ||
| f.NullValueMethod = o.NullValueMethod | ||
| f.ValueCastToType = o.CastToType | ||
| f.ValueCastFromType = o.CastFromType |
Contributor
There was a problem hiding this comment.
Todo for me later:
- fix the ValueCastFromType in Override
- write a test for the override or deprecate it?! It looks like it has been broken since forever.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR upgrades the
terraform-plugin-frameworkdependency from v0.10.0 to v0.16.0.There was a fairly major change to the
typespackage in v0.16.0, in which they made the majority of values immutable, and theValue,Null, andUnknownfields unexported.This is particularly awkward for our generated
Copy*ToTerraformmethods which would previously mutate the given object's attributes directly, but now need to construct new objects.User-facing changes
Copy*ToTerraformmethod signatureBefore:
After:
Custom type
CopyTo*method signatureBefore:
After:
Configuration changes
The
time_typeandduration_typestanzas now require three new options:value_from_method- the method that will be called on anattr.Valueto get the value for the protobuf structvalue_to_method- the (package-qualified) method that will be called to construct anattr.Valuefrom the protobuf struct valuenull_value_method- the (package-qualified) method that will be called to construct a nullattr.ValueThe
injected_fieldsstanzas now require avalue_methodoption, which is the (package-qualified) method that will be called to construct the value of the injected field, when it is not already set.