Skip to content

Update service account creation to be more resilient to eventual cons… #14547

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 3 commits into from
Jul 17, 2025

Conversation

chasevedder
Copy link
Member

@chasevedder chasevedder commented Jul 16, 2025

This changes service account creation to no longer require a final GetServiceAccount request to succeed. Instead, we will wait until we get 3 consecutive successful responses from GetServiceAccount before considering the create successful.

closes hashicorp/terraform-provider-google#22546

resourcemanager: updated service account creation to prevent failures due to eventual consistency in `google_service_account` resource 

@github-actions github-actions bot requested a review from zli82016 July 16, 2025 20:27
Copy link

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@zli82016, 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 ( 1 file changed, 36 insertions(+), 27 deletions(-))
google-beta provider: Diff ( 1 file changed, 36 insertions(+), 27 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 163
Passed tests: 132
Skipped tests: 30
Affected tests: 1

Click here to see the affected service packages
  • resourcemanager
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccServiceAccount_createIgnoreAlreadyExists

Get to know how VCR tests work

@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 ( 1 file changed, 36 insertions(+), 27 deletions(-))
google-beta provider: Diff ( 1 file changed, 36 insertions(+), 27 deletions(-))

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccServiceAccount_createIgnoreAlreadyExists [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

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 165
Passed tests: 134
Skipped tests: 30
Affected tests: 1

Click here to see the affected service packages
  • resourcemanager
#### Action taken
Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccServiceAccount_createIgnoreAlreadyExists

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccServiceAccount_createIgnoreAlreadyExists [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

transport_tpg.IsNotFoundRetryableError("service account creation"),
},
})

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we still want to set id in this case. We only want to avoid setting id if creation fails (i.e. we got a non-409 error or create_ignore_already_exists is false.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@github-actions github-actions bot requested a review from trodge July 17, 2025 21:55
@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 ( 1 file changed, 38 insertions(+), 27 deletions(-))
google-beta provider: Diff ( 1 file changed, 38 insertions(+), 27 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 163
Passed tests: 133
Skipped tests: 30
Affected tests: 0

Click here to see the affected service packages
  • resourcemanager
🟢 All tests passed!

View the build log

@zli82016 zli82016 added this pull request to the merge queue Jul 17, 2025
Merged via the queue into GoogleCloudPlatform:main with commit 1deff66 Jul 17, 2025
26 checks passed
@chasevedder chasevedder deleted the sa-errors branch July 17, 2025 23:14
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.

Error creating Service account
4 participants