-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add deletion_protection field to Memcache Instance #13603
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 Memcache Instance #13603
Conversation
Hello! I am a robot. Tests will require approval from a repository maintainer to run. Googlers: see go/terraform-auto-test-runs to set up automatic test runs. @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. |
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: 0 Click here to see the affected service packages
🔴 Tests were added that are skipped in VCR:
View the build log |
/gcbrun |
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.
whoops, missed actually leaving this review. Please be sure to run tests locally to make sure everything works to speed up the review process! (Especially basic unit tests to make sure the code compiles.)
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
"github.com/hashicorp/terraform-provider-google/google/acctest" | ||
"github.com/hashicorp/terraform-provider-google/google/envvar" |
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.
Causing the tests to not compile:
google-beta/services/memcache/resource_memcache_instance_test.go:12:2: "github.com/hashicorp/terraform-provider-google-beta/google-beta/envvar" imported and not used
Please be sure to run tests locally - at least unit tests - before pushing changes to a PR.
"github.com/hashicorp/terraform-provider-google/google/envvar" |
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.
Missing doc report (experimental)The following resources have fields missing in documents.
|
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.
Missing doc report (experimental)The following resources have fields missing in documents.
|
Tests analyticsTotal tests: 3 Click here to see the affected service packages
Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
1 similar comment
Tests analyticsTotal tests: 3 Click here to see the affected service packages
Action takenFound 3 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. |
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
@@ -37,7 +37,8 @@ async: | |||
base_url: '{{op_id}}' | |||
result: | |||
resource_inside_response: true | |||
custom_code: | |||
custom_code: !ruby/object:Provider::Terraform::CustomCode |
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.
This is no longer ruby-based yaml, so this is not necessary.
custom_code: !ruby/object:Provider::Terraform::CustomCode | |
custom_code: |
- name: 'deletion_protection' | ||
description: | | ||
Whether Terraform will be prevented from destroying the instance. Defaults to true. | ||
When a`terraform destroy` or `terraform apply` would delete the instance, |
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.
When a`terraform destroy` or `terraform apply` would delete the instance, | |
When a `terraform destroy` or `terraform apply` would delete the instance, |
mmv1/third_party/terraform/services/memcache/resource_memcache_instance_test.go
Show resolved
Hide resolved
}, | ||
{ | ||
Config: testAccMemcacheInstance_update(prefix, name, network), | ||
}, |
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.
}, | |
}, | |
{ | |
ResourceName: "google_memcache_instance.test", | |
ImportState: true, | |
ImportStateVerify: true, | |
ImportStateVerifyIgnore: []string{"reserved_ip_range_id", "deletion_protection"}, | |
}, |
ExpectError: regexp.MustCompile("deletion_protection"), | ||
}, | ||
{ | ||
Config: testAccMemcacheInstance_update(prefix, name, network), |
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.
Config: testAccMemcacheInstance_update(prefix, name, network), | |
Config: testAccMemcacheInstance_update(prefix, name, network), | |
ConfigPlanChecks: resource.ConfigPlanChecks{ | |
PreApply: []plancheck.PlanCheck{ | |
plancheck.ExpectResourceAction("google_memcache_instance.test", plancheck.ResourceActionUpdate), | |
}, | |
}, |
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.
Missing doc report (experimental)The following resources have fields missing in documents.
|
Tests analyticsTotal tests: 0 Click here to see the affected service packages
🔴 Tests were added that are skipped in VCR:
View the build log |
mmv1/third_party/terraform/services/memcache/resource_memcache_instance_test.go
Show resolved
Hide resolved
…_instance_test.go
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.
there are some gofmt issues that need to be fixed.
mmv1/third_party/terraform/services/memcache/resource_memcache_instance_test.go
Outdated
Show resolved
Hide resolved
mmv1/third_party/terraform/services/memcache/resource_memcache_instance_test.go
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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: 3 Click here to see the affected service packages
Action takenFound 3 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: 3 Click here to see the affected service packages
Action takenFound 3 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 failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Tests analyticsTotal tests: 3 Click here to see the affected service packages
Action takenFound 3 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. |
🔴 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.
|
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.
|
Tests analyticsTotal tests: 3 Click here to see the affected service packages
Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
1 similar comment
Tests analyticsTotal tests: 3 Click here to see the affected service packages
Action takenFound 3 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. |
🔴 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.
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. Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataproc_metastore_federation" "primary" {
tags = # value needed
}
|
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.
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. Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_dataproc_metastore_federation" "primary" {
tags = # value needed
}
|
Tests analyticsTotal tests: 38 Click here to see the affected service packages
Action takenFound 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
1 similar comment
Tests analyticsTotal tests: 38 Click here to see the affected service packages
Action takenFound 4 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. |
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
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 some of the previous changes I made on this branch were lost - please re-fix them. I've unresolved the relevant comments.
CheckDestroy: testAccCheckMemcacheInstanceDestroyProducer(t), | ||
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccMemcacheInstance_deletionprotection(prefix, name, network, "us-central1"), |
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.
This function needs to set deletion protection to true
. It's currently not, which is why the test is failing to see the expected error in step 3
Add deletion_protection field to make deletion actions require an explicit intent
Part of b/368232860
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.