-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: (storage) bucket policy delete 412 error #12944
base: main
Are you sure you want to change the base?
fix: (storage) bucket policy delete 412 error #12944
Conversation
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request.
If you believe this detection to be incorrect please raise the concern with your reviewer. |
Tests analyticsTotal tests: 109 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 109 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 109 Click here to see the affected service packages
🟢 All tests passed! View the build log |
Hello! I am a robot. Tests will require approval from a repository maintainer to run. @rileykarson, 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. |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 110 Click here to see the affected service packages
🟢 All tests passed! View the build log |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 110 Click here to see the affected service packages
🟢 All tests passed! View the build log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we added the etag on delete for GCS bucket in the first place. I can't find context on why yet, but looking into it: #2794
edit: original context in hashicorp/terraform-provider-google#1190 (comment)
When just an empty bindings
block is sent we get back:
{
"error": {
"code": 400,
"message": "A policy to update must be provided.",
"errors": [
{
"message": "A policy to update must be provided.",
"domain": "global",
"reason": "required"
}
]
}
}
agree but the request body we are sending will look like below without etag the request is accepted and policy got updated and response is 200 response: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe there is a server side validation for rejecting an empty Buckets:setIamPolicy
request. I tested compute setIamPolicy
method which allows empty policy and clears if provided. Specifying policy version in the Buckets:setIamPolicy method request should be enough to clear IAM bindings.
Yep- in my testing any value in addition to the empty |
I added below logic to remove etag only when bindings are empty or null in this change and converted auto generated to handwritten resource, below is only extra logic added to existing iam_bucket if policy.Bindings == nil || len(policy.Bindings) == 0 { |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 110 Click here to see the affected service packages
🟢 All tests passed! View the build log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do update here when PR is ready for review. I don't see handwritten documentation file and tests for other cases.
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 110 Click here to see the affected service packages
🟢 All tests passed! View the build log |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
|
Tests analyticsTotal tests: 118 Click here to see the affected service packages
🔴 Tests were added that are skipped in VCR:
Action takenFound 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🟢 All tests passed! |
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
Fixes: hashicorp/terraform-provider-google#20838
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.