Skip to content

Add information about failing member into the error message #13146

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

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

wiktorn
Copy link
Contributor

@wiktorn wiktorn commented Feb 21, 2025

When working with dynamically generated list of IAM resources, the error message is not that useful:

Error: invalid value for member (IAM members must have one of the values outlined here: https://cloud.google.com/billing/docs/reference/rest/v1/Policy#Binding)

  with module.projects-iam["service1"].google_project_iam_member.shared_vpc_host_iam["rw"],
  on ../project/shared-vpc.tf line 131, in resource "google_project_iam_member" "shared_vpc_host_iam":
 131:   member     = each.value

It makes hard to actually identify offending value. Returning failing member value helps to narrow down, which value was passed incorrectly.

See Write release notes for guidance.

iam: added member value to the error message when member validation fails for google_project_iam_*

@github-actions github-actions bot requested a review from melinath February 21, 2025 07:47
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@melinath, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 4 files changed, 4 insertions(+), 4 deletions(-))
google-beta provider: Diff ( 4 files changed, 4 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 4608
Passed tests: 4172
Skipped tests: 432
Affected tests: 4

Click here to see the affected service packages

All service packages are affected

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager
  • TestAccCloudbuildWorkerPool_basic
  • TestAccDataSourceGoogleGkeHubFeature_basic
  • TestAccEphemeralServiceAccountKey_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager [Debug log]
TestAccDataSourceGoogleGkeHubFeature_basic [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccDataSourceGoogleGkeHubFeature_basic [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccCloudbuildWorkerPool_basic [Error message] [Debug log]
TestAccEphemeralServiceAccountKey_basic [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@wiktorn
Copy link
Contributor Author

wiktorn commented Feb 21, 2025

All 3 failures looks like unrelated to the change

@melinath
Copy link
Member

agreed - failing tests are unrelated. This seems like a straightforward improvement.

@melinath
Copy link
Member

Note: This changes all IAM resources, but doesn't need to modify all tests because most tests don't cover the error behavior. VCR tests all reran so there shouldn't be any new failures due to this.

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

Successfully merging this pull request may close these issues.

3 participants