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

Computed values within nested object types in AssertPlanValid #29482

Merged
merged 4 commits into from
Aug 31, 2021

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Aug 30, 2021

Some fixes for nested object attribute handling in AssertPlanValid.

  • The validation for nested object types with computed attributes was using the incorrect function call for individual attributes.
  • When using NestedMap objects, unify the codepath for both maps and objects as they may be interchangeable.
  • While blocks were not allowed to be computed by the provider, nested objects can be. Remove the errors regarding blocks and test unknown values are valid.

Fixes #29473

The validation for nested object types with computed attributes was
using the incorrect function call.
When using NestedMap objects, unify the codepath for both maps and
objects as they may be interchangeable.
While blocks were not allowed to be computed by the provider, nested
objects can be. Remove the errors regarding blocks and verify unknown
values are valid.
@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 30, 2021
@jbardin jbardin requested a review from a team August 30, 2021 18:33
@@ -1256,3 +1486,85 @@ func TestAssertPlanValid(t *testing.T) {
})
}
}

func TestAssertPlanValidTEST(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What does the "TEST" at the end of this function name represent? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, that was my temporary test harness for trying out values. I'll delete that before merging!

@github-actions
Copy link

github-actions bot commented Oct 1, 2021

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 Oct 1, 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: value is not an object" when MapNestedAttributes contains more than one computed attribute
2 participants