Skip to content
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

Backport of plan renderer: fix crash when updating a null attribute to unknown into v1.9 #35712

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

github-actions[bot]
Copy link

Backport

This PR is auto-generated from #35709 to be assessed for backporting due to the inclusion of the label 1.9-backport.

The below text is copied from the body of the original PR.


This PR fixes a crash in the plan renderer that occurs when a plan marks an attribute that was null as becoming unknown.

The renderer had assumed that all computed attributes would have a value if the resource was being updated, so was only checking for plans.Create actions before deciding whether to render the "before" part of an unknown change. Now, we explicitly check whether the before part has a renderer at all when deciding whether to render the before part rather than simply relying on a logical consistency based on the false assumption it would only ever be create actions doing this.

There's also a flyby fix of the block renderers which can now successfully render blocks becoming unknown as update actions instead of create since that does not crash anymore.

Note, we could render this as something like ~ attr = null -> (known after apply), instead of just ~ attr = (known after apply), but I don't think we do that elsewhere (like when an optional attribute is set during an update operation) so I didn't implement it here but it would be trivial to do.

Fixes #35630

Target Release

v1.9.7

Draft CHANGELOG entry

BUG FIXES

  • Plan renderer: Fix crash that occurs when updating a null attribute to unknown

Overview of commits

@github-actions github-actions bot force-pushed the backport/liamcervante/35630/horribly-still-whale branch from ff1cf3f to 9f5af29 Compare September 11, 2024 12:28
@liamcervante liamcervante marked this pull request as ready for review September 11, 2024 12:28
@liamcervante liamcervante merged commit 119edd3 into v1.9 Sep 11, 2024
5 of 6 checks passed
@liamcervante liamcervante deleted the backport/liamcervante/35630/horribly-still-whale branch September 11, 2024 12:35
Copy link
Author

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant