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

Integrate with new Cloud SQL deletion protection

Open ShubhamAvasthi opened this issue 2 years ago • 34 comments

I acknowledge that I have:

  • [X] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • [X] Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • [X] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • [X] Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • [x] Read the Release Notes Guide before writing my release note below.

Release Note for Downstream PRs

sql_database_instance: Integrated Terraform provider's [existing](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance#deletion_protection) deletion protection feature with [new](https://cloud.google.com/sql/docs/mysql/deletion-protection) Cloud SQL accidental deletion protection feature.

ShubhamAvasthi avatar Aug 22 '22 12:08 ShubhamAvasthi

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @c2thorn, a repository maintainer, has been assigned to assist you and help review your changes.

:question: First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


modular-magician avatar Aug 22 '22 12:08 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 6 insertions(+)) Terraform Beta: Diff ( 1 file changed, 6 insertions(+)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 22 '22 12:08 modular-magician

The provider crashed while running the VCR tests in REPLAYING mode Please fix it to complete your PR View the build log

modular-magician avatar Aug 22 '22 13:08 modular-magician

@c2thorn The test failure looks like a flakiness issue. Can we rerun the tests? Also, where can I document the change we are doing? Basically, this change will protect instances from deletion not just in Terraform, but across other surfaces like gcloud and API as well.

ShubhamAvasthi avatar Aug 23 '22 10:08 ShubhamAvasthi

@c2thorn, just to add, I looked at the testing documentation here, but it does not explain where can I add details about the change. I want to document that we are using Cloud SQL's new accidental deletion protection feature not Terraform's local deletion protection.

ShubhamAvasthi avatar Aug 23 '22 11:08 ShubhamAvasthi

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 6 insertions(+)) Terraform Beta: Diff ( 1 file changed, 6 insertions(+)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 25 '22 08:08 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 119 insertions(+), 109 deletions(-)) Terraform Beta: Diff ( 1 file changed, 119 insertions(+), 109 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 25 '22 09:08 modular-magician

Tests analytics

Total tests: 0 Passed tests 0 Skipped tests: 0 Failed tests: 0

Errors occurred during REPLAYING mode. Please fix them to complete your PR View the build log

modular-magician avatar Aug 25 '22 09:08 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 9 insertions(+)) Terraform Beta: Diff ( 1 file changed, 9 insertions(+)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Aug 25 '22 09:08 modular-magician

@ShubhamAvasthi ShubhamAvasthi requested review from multani and removed request for c2thorn 4 minutes ago

You can keep @c2thorn as the main reviewer, I don't have any power here :)

multani avatar Aug 25 '22 09:08 multani

I removed @c2thorn by mistake and it looks like I cannot add him back. I have contacted him internally so that he adds himself back as a reviewer.

ShubhamAvasthi avatar Aug 25 '22 09:08 ShubhamAvasthi

The provider crashed while running the VCR tests in REPLAYING mode Please fix it to complete your PR View the build log

modular-magician avatar Aug 25 '22 09:08 modular-magician

@c2thorn, I will send you an email internally, which will address your concerns and explain our idea behind this change.

ShubhamAvasthi avatar Aug 26 '22 04:08 ShubhamAvasthi

@c2thorn, can you also please help me understand why the provider is crashing while running VCR tests? It does not look like it's caused by my changes.

ShubhamAvasthi avatar Aug 26 '22 06:08 ShubhamAvasthi

Any progress on this change? Can I help in any ways?

multani avatar Sep 07 '22 06:09 multani

@multani, there are a few different ways of implementing the feature in Terraform, each with its pros and cons. We have not been able to have consensus on it, but will hopefully close this soon.

Thanks for offering to help but we will handle it!

ShubhamAvasthi avatar Sep 07 '22 09:09 ShubhamAvasthi

The PR was closed because of a force push. I am reopening it.

ShubhamAvasthi avatar Sep 12 '22 05:09 ShubhamAvasthi

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 05:09 modular-magician

Tests analytics

Total tests: 2171 Passed tests 1930 Skipped tests: 236 Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCGCSnippet_eventarcWorkflowsExample|TestAccFirebaserulesRelease_BasicRelease|TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled

modular-magician avatar Sep 12 '22 06:09 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[Debug log] TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode: TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log] TestAccCGCSnippet_eventarcWorkflowsExample[Error message] [Debug log] TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled[Error message] [Debug log]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Sep 12 '22 06:09 modular-magician

Reopening the PR.

ShubhamAvasthi avatar Sep 12 '22 07:09 ShubhamAvasthi

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 07:09 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 103 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 07:09 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 105 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 105 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 07:09 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 105 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 105 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 07:09 modular-magician

Tests analytics

Total tests: 2171 Passed tests 1930 Skipped tests: 236 Failed tests: 5

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled|TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccFirebaserulesRelease_BasicRelease|TestAccComputeInstance_soleTenantNodeAffinities|TestAccCGCSnippet_eventarcWorkflowsExample

modular-magician avatar Sep 12 '22 08:09 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[Debug log] TestAccFirebaserulesRelease_BasicRelease[Debug log]

Tests failed during RECORDING mode: TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled[Error message] [Debug log] TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log] TestAccCGCSnippet_eventarcWorkflowsExample[Error message] [Debug log]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Sep 12 '22 08:09 modular-magician

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 106 insertions(+), 31 deletions(-)) Terraform Beta: Diff ( 3 files changed, 106 insertions(+), 31 deletions(-)) TF Validator: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

modular-magician avatar Sep 12 '22 13:09 modular-magician

Tests analytics

Total tests: 2172 Passed tests 1931 Skipped tests: 237 Failed tests: 4

Action taken

Triggering VCR tests in RECORDING mode for the tests that failed during VCR. Click here to see the failed tests
TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample|TestAccComputeInstance_soleTenantNodeAffinities|TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample|TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled

modular-magician avatar Sep 12 '22 14:09 modular-magician

Tests passed during RECORDING mode: TestAccPrivatecaCertificateAuthority_privatecaCertificateAuthoritySubordinateExample[Debug log] TestAccBigtableAppProfile_bigtableAppProfileAnyclusterExample[Debug log]

Tests failed during RECORDING mode: TestAccComputeInstance_soleTenantNodeAffinities[Error message] [Debug log] TestAccSqlDatabaseInstance_settings_deletionProtectionEnabled[Error message] [Debug log]

Please fix these to complete your PR View the build log or the debug log for each test

modular-magician avatar Sep 12 '22 14:09 modular-magician