-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add state preserving plan modifiers #204
Conversation
ce9e0fb
to
e33b1ba
Compare
I updated this to be more robust around how it's handling null states, to only ever overwrite unknown values, and to preserve unknown config values (interpolated values). I also added unit test cases verifying the above. I think it's ready for review. |
Update the framework to use hashicorp/terraform-plugin-framework#204. Add "language" as a property of user, simulating an optional+computed value with a default. Add "date_joined" as a property of user, simulating a write-once computed-only value. Update framework user tests to check actual values (which we can do, because they're known) instead of using unnecessary regular expressions. Check all the attributes in state for our framework user tests. Add framework user test that language can optionally be set. Add framework user test that language can be interpolated successfully even with the PreserveState modifier on it.
b0bf04e
to
1d1b129
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on board with this -- just some non-blocking items to consider. 🚀
8ddd464
to
e746c9e
Compare
Think I addressed the comments. Still feel good about it, @bflad? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent 🚀
Fix checking attribute state to properly handle null values.
We don't want to override the optional+computed values that actually gain a config value, for example.
Co-authored-by: Brian Flad <bflad417@gmail.com>
e746c9e
to
b3785d9
Compare
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Closes #180
Needs careful testing.