-
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
Add deletion_protection field to Folders resource #11293
Add deletion_protection field to Folders resource #11293
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.
|
1 similar comment
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.
|
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. |
Tests analyticsTotal tests: 1271 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 analyticsTotal tests: 1271 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: 1271 Click here to see the affected service packages
Action takenFound 68 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
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.
Please make sure that deletion_protection gets set in the import function similar to https://github.com/hashicorp/terraform-provider-google-beta/blob/a4bdc631489c4974394ba18123ecf32baa30109a/google-beta/services/container/resource_container_cluster.go#L6488-L6490
|
Added. Thanks! |
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: 1271 Click here to see the affected service packages
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.
I ended up checking with some other folks on the team to reconcile some differences between how this was implemented compared to some other deletion_protection fields and have created #11330 to document the best practices.
Basically the changes for you to make (assuming that I got everything down right in that PR) are:
- Set deletion_protection in read (as described in the new docs)
- Add logic to skip API requests if only deletion_protection is being modified (not strictly necessary but good to do)
- Remove setting of deletion protection in import (it seems like it may not be necessary after all if it's getting set in read - sorry to ask you to remove something I just asked you to add!)
I wanted to let you know about these changes in guidance even though they're not fully merged yet so that you can get a head start - but feel free to wait until it's merged if you prefer. (FYI there's a chance that setting during Import actually does need to be there due to some edge case that I wasn't able to figure out, but I think it probably ought to go.)
…01-add-deletion-protection
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.
|
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: 1137 Click here to see the affected service packages
View the build log |
Tests analyticsTotal tests: 1137 Click here to see the affected service packages
View the build log |
@melinath could you please review? |
I don't see anything either - rerunning to see if it's a flake /gcbrun |
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: 1137 Click here to see the affected service packages
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 looks like the error is coming from the data source tests, because the folder datasource doesn't have deletion_protection
in its schema. You'll need to add it to the schema (and add a few lines that set it to nil, because it's not meaningful in that context.)
Something like:
# In schema
"deletion_protection": {
Type: schema.TypeBool,
Computed: true,
},
# In Read
if err := d.Set("deletion_protection", nil); err != nil {
return fmt.Errorf("Error setting deletion_protection: %s", err)
}
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: 1273 Click here to see the affected service packages
View the build log |
Done, thanks! |
The google_folder data source almost certainly pre-dates the tooling to reuse the resource schema... we could hypothetically switch it over but there probably hasn't been a reason to (and I'm not 100% sure it would Just Work without doing further investigation.) |
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.
LGTM, thanks!
a31848e
into
GoogleCloudPlatform:FEATURE-BRANCH-major-release-6.0.0
Add deletion_protection field to make deletion actions require an explicit intent
Part of b/330143705
Fixes hashicorp/terraform-provider-google#18904
Release Note Template for Downstream PRs (will be copied)