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

internal/toproto*: Convert null list/set block values to empty #621

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 12, 2023

Reference: #604
Closes #620

This logic implements the inverse of what was added to internal/fromproto* where empty block values are converted to null. While Terraform implements some logic to automatically convert these for state responses from ReadResource and others, the same null values can cause errors with Terraform's plan validity logic.

This fixes the potential new error caused by only introducing the internal/fromproto* logic, which was not released and why it does not contain a changelog entry in that regard, However, this change is considered an overall enhancement prior and including those changes since it means the provider developers will no longer be burdened with understanding Terraform's implementation details with null versus empty collection blocks when setting values for responses.

Reference: #604
Reference: #620

This logic implements the inverse of what was added to `internal/fromproto*` where empty block values are converted to null. While Terraform implements some logic to automatically convert these for state responses from `ReadResource` and others, the same null values can cause errors with Terraform's plan validity logic.

This fixes the potential new error caused by only introducing the `internal/fromproto*` logic, which was not released and why it does not contain a changelog entry in that regard, However, this change is considered an overall enhancement prior and including those changes since it means the provider developers will no longer be burdened with understanding Terraform's implementation details with null versus empty collection blocks when setting values for responses.
@bflad bflad added the enhancement New feature or request label Jan 12, 2023
@bflad bflad added this to the v1.1.0 milestone Jan 12, 2023
@bflad bflad requested a review from a team as a code owner January 12, 2023 17:29
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@bflad bflad merged commit 620823f into main Jan 13, 2023
@bflad bflad deleted the bflad/toproto-block-nulls branch January 13, 2023 14:16
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

internal/toproto*: Convert Null List/Set Blocks to Empty
2 participants