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

handle null and unknown values in attr diffs #29410

Merged
merged 1 commit into from
Aug 18, 2021

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Aug 18, 2021

The code adopted from block diffs was not set to handle null and unknown
values, as those are not allowed for blocks. While there is much room for
improvement in the formatting code, this PR takes care to only update the
new code paths for formatting so as to not disturb the rather fragile existing
block formatting code.

We also revert the change to formatting nested object types as single
attributes, because the attribute formatter cannot handle sensitive
values from the schema. This presents some awkward syntax for diffs for
now, but should suffice until the entire formatter can be refactored to
better handle these new nested types.

Fixes #29392

@jbardin jbardin added the 1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Aug 18, 2021
@jbardin jbardin requested a review from a team August 18, 2021 17:24
The code adopted from block diffs was not set to handle null and unknown
values, as those are not allowed for blocks.

We also revert the change to formatting nested object types as single
attributes, because the attribute formatter cannot handle sensitive
values from the schema. This presents some awkward syntax for diffs for
now, but should suffice until the entire formatter can be refactored to
better handle these new nested types.
@jbardin jbardin force-pushed the jbardin/format-empty-nested-attrs branch from 4c321ab to 68ed506 Compare August 18, 2021 18:12
Copy link
Contributor

@alisdair alisdair left a comment

Choose a reason for hiding this comment

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

This looks like a good compromise to me! I don't see any neat way to render empty collections on a single line without a big restructure, and the slightly less pretty diff doesn't feel like that big of a deal.

@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 Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic with Computed MapNestedAttributes
2 participants