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

fix: add path to error when list has too many or few items #826

Merged
merged 1 commit into from Aug 29, 2022

Conversation

josh-barker
Copy link
Contributor

This PR adds the resource path to error messages when a list type either has too many or too few elements.

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Hi @josh-barker 👋 Thank you for submitting this and apologies for the delayed review.

This partially relates to some of the discussion in hashicorp/terraform#31575, so therefore I think this adjustment is acceptable because even if Terraform added the attribute path information to the diagnostic output, it would only show up in newer versions of Terraform while this would cover all cases of Terraform 0.12 and later when providers update their SDK version to one containing this change.

Would you be able to rebase this and ensure the unit testing is passing? Once that is done, we can get this in. Thanks again.

@bflad bflad added the bug Something isn't working label Aug 26, 2022
@bflad bflad self-assigned this Aug 26, 2022
@josh-barker josh-barker requested a review from a team as a code owner August 28, 2022 23:04
@josh-barker josh-barker requested a review from bflad August 28, 2022 23:08
@bflad bflad added this to the v2.22.0 milestone Aug 29, 2022
bflad
bflad approved these changes Aug 29, 2022
Copy link
Member

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me 🚀 Thanks so much, @josh-barker

@bflad bflad merged commit fa8d313 into hashicorp:main Aug 29, 2022
5 checks passed
bflad added a commit that referenced this pull request Aug 29, 2022
@josh-barker
Copy link
Contributor Author

You're welcome @bflad ! 🙂

@josh-barker josh-barker deleted the fix/list-validation-details branch August 29, 2022 23:45
@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 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants