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

Treat _Default & _Required Sinks same as buckets #9384

Merged
merged 7 commits into from
Nov 13, 2023

Conversation

zachberger
Copy link
Member

Fixes terraform-provider-google#7811

The google_logging_project_bucket_config resource graciously handles the “_Default” bucket by acquiring and updating the resource that already exists at the desired location. This PR updates google_logging_project_sink to behave the same way.

Release Note Template for Downstream PRs (will be copied)

logging: `google_logging_project_sink` now will aqcuire and update the resource that already exists at the desired location. These buckets cannot be removed so deleting this resource will remove the bucket config from your terraform state but will leave the logging bucket unchanged.   

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will require approval to run.

@roaks3, 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 modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Oct 31, 2023
Copy link
Contributor

@roaks3 roaks3 left a comment

Choose a reason for hiding this comment

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

I had a few nits on copy, but the code LGTM. Will wait on VCR tests to make sure.

@roaks3
Copy link
Contributor

roaks3 commented Nov 2, 2023

/gcbrun

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

Terraform GA: Diff ( 3 files changed, 57 insertions(+), 15 deletions(-))
Terraform Beta: Diff ( 3 files changed, 57 insertions(+), 15 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3198
Passed tests 2860
Skipped tests: 325
Affected tests: 13

Action taken

Found 13 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigQueryDatasetAccess_iamMember|TestAccLoggingProjectSink_disabled_update|TestAccLoggingProjectSink_updateBigquerySink|TestAccLoggingProjectSink_loggingbucket|TestAccLoggingProjectSink_heredoc|TestAccLoggingProjectSink_updatePreservesCustomWriter|TestAccLoggingProjectSink_default|TestAccLoggingProjectSink_disabled|TestAccLoggingProjectSink_described_update|TestAccLoggingProjectSink_basic|TestAccDataSourceGoogleLoggingSink_basic|TestAccLoggingProjectSink_described|TestAccLoggingProjectSink_updatePreservesUniqueWriter

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryDatasetAccess_iamMember[Debug log]
TestAccLoggingProjectSink_disabled_update[Debug log]
TestAccLoggingProjectSink_updateBigquerySink[Debug log]
TestAccLoggingProjectSink_loggingbucket[Debug log]
TestAccLoggingProjectSink_heredoc[Debug log]
TestAccLoggingProjectSink_disabled[Debug log]
TestAccLoggingProjectSink_described_update[Debug log]
TestAccLoggingProjectSink_basic[Debug log]
TestAccDataSourceGoogleLoggingSink_basic[Debug log]
TestAccLoggingProjectSink_described[Debug log]
TestAccLoggingProjectSink_updatePreservesUniqueWriter[Debug log]

Rerun these tests in REPLAYING mode to catch issues

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccLoggingProjectSink_updatePreservesCustomWriter[Error message] [Debug log]
TestAccLoggingProjectSink_default[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
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.

Terraform GA: Diff ( 4 files changed, 60 insertions(+), 22 deletions(-))
Terraform Beta: Diff ( 4 files changed, 60 insertions(+), 22 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3204
Passed tests 2865
Skipped tests: 323
Affected tests: 16

Action taken

Found 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccContainerAwsCluster_BetaBasicHandWritten|TestAccContainerAwsCluster_BetaBasicEnumHandWritten|TestAccLoggingProjectSink_default|TestAccLoggingOrganizationSink_update|TestAccLoggingFolderSink_update|TestAccLoggingFolderSink_removeOptionals|TestAccLoggingProjectSink_described_update|TestAccLoggingFolderSink_updateBigquerySink|TestAccLoggingProjectSink_disabled_update|TestAccLoggingProjectSink_updatePreservesCustomWriter|TestAccLoggingBillingAccountSink_update|TestAccLoggingOrganizationSink_updateBigquerySink|TestAccLoggingBillingAccountSink_updateBigquerySink|TestAccLoggingProjectSink_updateBigquerySink|TestAccLoggingProjectSink_updatePreservesUniqueWriter|TestAccDataSourceGoogleServiceAccountJwt

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccContainerAwsCluster_BetaBasicHandWritten[Debug log]
TestAccContainerAwsCluster_BetaBasicEnumHandWritten[Debug log]
TestAccLoggingProjectSink_default[Debug log]
TestAccLoggingOrganizationSink_update[Debug log]
TestAccLoggingFolderSink_update[Debug log]
TestAccLoggingFolderSink_removeOptionals[Debug log]
TestAccLoggingProjectSink_described_update[Debug log]
TestAccLoggingFolderSink_updateBigquerySink[Debug log]
TestAccLoggingProjectSink_disabled_update[Debug log]
TestAccLoggingBillingAccountSink_update[Debug log]
TestAccLoggingOrganizationSink_updateBigquerySink[Debug log]
TestAccLoggingBillingAccountSink_updateBigquerySink[Debug log]
TestAccLoggingProjectSink_updateBigquerySink[Debug log]
TestAccLoggingProjectSink_updatePreservesUniqueWriter[Debug log]
TestAccDataSourceGoogleServiceAccountJwt[Debug log]

Rerun these tests in REPLAYING mode to catch issues

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


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccLoggingProjectSink_updatePreservesCustomWriter[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

@zachberger
Copy link
Member Author

zachberger commented Nov 5, 2023

I do not believe the remaining failure is related to my changes.

In TestAccLoggingProjectSink_updatePreservesCustomWriter I believe google_logging_project_sink.custom_writer needs to be dependent on the IAM resource google_service_account_iam_member.loggingsa-customsa-binding. I think there were recent changes in the API that added validation for this at google_logging_project_sink creation time. 693d184 attempts to test this hypothesis.

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

Terraform GA: Diff ( 4 files changed, 68 insertions(+), 24 deletions(-))
Terraform Beta: Diff ( 4 files changed, 68 insertions(+), 24 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3204
Passed tests 2880
Skipped tests: 323
Affected tests: 1

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
TestAccLoggingProjectSink_updatePreservesCustomWriter

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

Rerun these tests in REPLAYING mode to catch issues

$\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

@zachberger
Copy link
Member Author

Looks like the hypothesis in #9384 (comment) was correct

@roaks3
Copy link
Contributor

roaks3 commented Nov 7, 2023

I will be OOO for the rest of the week, so transferring this review to another team member in case there is progress during that time.

Note that there is some internal discussion at b/304503197

@roaks3 roaks3 requested a review from slevenick November 7, 2023 22:03
@zachberger
Copy link
Member Author

@slevenick I believe all concerns have been resolved. PTAL and let me know if there is anything outstanding before approval.

@slevenick slevenick merged commit 4076318 into GoogleCloudPlatform:main Nov 13, 2023
6 checks passed
@zachberger
Copy link
Member Author

Thanks @slevenick

swamitagupta pushed a commit to swamitagupta/magic-modules that referenced this pull request Nov 14, 2023
…#9384)

* Treat _Default & _Required Sinks same as buckets

* Update documentation.

* Update exclusions every time.

* Do not check if _Default bucket has been deleted.

* Clean-up log statements.

* Fixup documentation.

* Ensure SA IAM set before associating with bucket.
davcen pushed a commit to davcen/gcp-magic-modules that referenced this pull request Nov 17, 2023
…#9384)

* Treat _Default & _Required Sinks same as buckets

* Update documentation.

* Update exclusions every time.

* Do not check if _Default bucket has been deleted.

* Clean-up log statements.

* Fixup documentation.

* Ensure SA IAM set before associating with bucket.
trodge pushed a commit to trodge/magic-modules that referenced this pull request Nov 27, 2023
…#9384)

* Treat _Default & _Required Sinks same as buckets

* Update documentation.

* Update exclusions every time.

* Do not check if _Default bucket has been deleted.

* Clean-up log statements.

* Fixup documentation.

* Ensure SA IAM set before associating with bucket.
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 28, 2023
…#9384)

* Treat _Default & _Required Sinks same as buckets

* Update documentation.

* Update exclusions every time.

* Do not check if _Default bucket has been deleted.

* Clean-up log statements.

* Fixup documentation.

* Ensure SA IAM set before associating with bucket.
jialei-chen pushed a commit to jialei-chen/magic-modules that referenced this pull request Nov 29, 2023
…#9384)

* Treat _Default & _Required Sinks same as buckets

* Update documentation.

* Update exclusions every time.

* Do not check if _Default bucket has been deleted.

* Clean-up log statements.

* Fixup documentation.

* Ensure SA IAM set before associating with bucket.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_logging_project_sink does not work for automatically created sinks
4 participants