magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Remove most calls to 'GetServiceAccount' in the create path

Open chasevedder opened this issue 1 year ago • 15 comments

Removes calls to GetServiceAccount in all cases except when create_ignore_already_exists=true and the Service Account already exists. This should eliminate most cases of the "Provider produced inconsistent result after apply" that occurs when creating new Service Accounts.

This bug occurs when a Service Account is created successfully but GetServiceAccount returns a 404 due to eventual consistency. We have all the information we need from the input config and the CreateServiceAccount response, so there's no need to make requests to GetServiceAccount at all.

Release Note Template for Downstream PRs (will be copied)

iam: Fix most instances of the "Provider produced inconsistent result after apply" bug for `google_service_account` resources.

chasevedder avatar May 23 '24 00:05 chasevedder

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

@slevenick, 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.

github-actions[bot] avatar May 23 '24 00:05 github-actions[bot]

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 ( 2 files changed, 40 insertions(+), 52 deletions(-)) google-beta provider: Diff ( 2 files changed, 40 insertions(+), 52 deletions(-))

modular-magician avatar May 23 '24 00:05 modular-magician

Tests analytics

Total tests: 141 Passed tests: 108 Skipped tests: 30 Affected tests: 3

Click here to see the affected service packages
  • resourcemanager

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccServiceAccount_Disabled|TestAccServiceAccount_basic|TestAccServiceAccount_createIgnoreAlreadyExists

Get to know how VCR tests work

modular-magician avatar May 23 '24 00:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccServiceAccount_basic[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccServiceAccount_Disabled[Error message] [Debug log] TestAccServiceAccount_createIgnoreAlreadyExists[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar May 23 '24 01:05 modular-magician

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 ( 2 files changed, 54 insertions(+), 88 deletions(-)) google-beta provider: Diff ( 2 files changed, 54 insertions(+), 88 deletions(-))

modular-magician avatar May 23 '24 23:05 modular-magician

Tests analytics

Total tests: 141 Passed tests: 109 Skipped tests: 30 Affected tests: 2

Click here to see the affected service packages
  • resourcemanager

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccServiceAccount_Disabled|TestAccServiceAccount_createIgnoreAlreadyExists

Get to know how VCR tests work

modular-magician avatar May 23 '24 23:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccServiceAccount_Disabled[Debug log] TestAccServiceAccount_createIgnoreAlreadyExists[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test

modular-magician avatar May 23 '24 23:05 modular-magician

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 ( 2 files changed, 65 insertions(+), 70 deletions(-)) google-beta provider: Diff ( 2 files changed, 65 insertions(+), 70 deletions(-))

modular-magician avatar May 24 '24 04:05 modular-magician

Tests analytics

Total tests: 141 Passed tests: 94 Skipped tests: 30 Affected tests: 17

Click here to see the affected service packages
  • resourcemanager

Action taken

Found 17 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDatasourceGoogleServiceAccountKey_basic|TestAccDatasourceGoogleServiceAccount_basic|TestAccServiceAccountIamBinding|TestAccServiceAccountIamBinding_federatedIdentity|TestAccServiceAccountIamBinding_withCondition|TestAccServiceAccountIamMember|TestAccServiceAccountIamMember_federatedIdentity|TestAccServiceAccountIamMember_withCondition|TestAccServiceAccountIamPolicy|TestAccServiceAccountIamPolicy_federatedIdentity|TestAccServiceAccountIamPolicy_withCondition|TestAccServiceAccountKey_basic|TestAccServiceAccountKey_fromCertificate|TestAccServiceAccountKey_fromEmail|TestAccServiceAccount_Disabled|TestAccServiceAccount_basic|TestAccServiceAccount_existingResourceCreateIgnoreAlreadyExists

Get to know how VCR tests work

modular-magician avatar May 24 '24 04:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccDatasourceGoogleServiceAccountKey_basic[Debug log] TestAccDatasourceGoogleServiceAccount_basic[Debug log] TestAccServiceAccountIamBinding[Debug log] TestAccServiceAccountIamBinding_federatedIdentity[Debug log] TestAccServiceAccountIamBinding_withCondition[Debug log] TestAccServiceAccountIamMember[Debug log] TestAccServiceAccountIamMember_federatedIdentity[Debug log] TestAccServiceAccountIamMember_withCondition[Debug log] TestAccServiceAccountIamPolicy[Debug log] TestAccServiceAccountIamPolicy_federatedIdentity[Debug log] TestAccServiceAccountIamPolicy_withCondition[Debug log] TestAccServiceAccountKey_basic[Debug log] TestAccServiceAccountKey_fromCertificate[Debug log] TestAccServiceAccountKey_fromEmail[Debug log] TestAccServiceAccount_Disabled[Debug log] TestAccServiceAccount_basic[Debug log] TestAccServiceAccount_existingResourceCreateIgnoreAlreadyExists[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test

modular-magician avatar May 24 '24 04:05 modular-magician

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 ( 2 files changed, 88 insertions(+), 70 deletions(-)) google-beta provider: Diff ( 2 files changed, 88 insertions(+), 70 deletions(-))

modular-magician avatar May 24 '24 08:05 modular-magician

Tests analytics

Total tests: 141 Passed tests: 109 Skipped tests: 30 Affected tests: 2

Click here to see the affected service packages
  • resourcemanager

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccServiceAccount_Disabled|TestAccServiceAccount_basic

Get to know how VCR tests work

modular-magician avatar May 24 '24 08:05 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccServiceAccount_Disabled[Debug log] TestAccServiceAccount_basic[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$ View the build log or the debug log for each test

modular-magician avatar May 24 '24 08:05 modular-magician

This PR has been waiting for review for 2 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar May 28 '24 09:05 github-actions[bot]

Postponing this for broader discussion with the team and deferring to https://github.com/GoogleCloudPlatform/magic-modules/pull/10813 to solve the immediate problem

c2thorn avatar May 28 '24 21:05 c2thorn

Hey! I'm closing this PR as a part of a cleanup of older inactive PRs, using a threshold of PRs last updated over 3 months ago. This doesn't represent rejection of the change, and feel free to comment for me to reopen it if you plan to pick it back up, or feel free to start a new PR with the same changes in the future.

rileykarson avatar Sep 06 '24 19:09 rileykarson