Skip to content

adds deletion_policy field generation to templates#16075

Merged
NickElliot merged 10 commits intoGoogleCloudPlatform:FEATURE-BRANCH-universal-deletion-policyfrom
NickElliot:deletionprotectiontemplate
Feb 4, 2026
Merged

adds deletion_policy field generation to templates#16075
NickElliot merged 10 commits intoGoogleCloudPlatform:FEATURE-BRANCH-universal-deletion-policyfrom
NickElliot:deletionprotectiontemplate

Conversation

@NickElliot
Copy link
Copy Markdown
Contributor

PR 1 of hashicorp/terraform-provider-google#25072

Adds ability to generate a deletion policy field via an opt-in flag.

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.


@modular-magician
Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@NickElliot NickElliot force-pushed the deletionprotectiontemplate branch from d2034ec to f7577cc Compare February 3, 2026 20:34
@NickElliot NickElliot changed the base branch from main to FEATURE-BRANCH-universal-deletion-policy February 3, 2026 20:35
@NickElliot NickElliot requested a review from c2thorn February 3, 2026 20:36
@NickElliot
Copy link
Copy Markdown
Contributor Author

NickElliot commented Feb 3, 2026

Due to errors in #16076 from the size of the PR, swapping these generator changes to be done in product based batches. Following this PR I will bring the project flag into the swap PR, but maintain the need for it to be flagged true.

Once all the product directories are merged into the feature branch, I will remove the project flag and there should be no diffs in this feature branch.

@NickElliot NickElliot marked this pull request as ready for review February 3, 2026 20:38
@modular-magician
Copy link
Copy Markdown
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.

google provider: Diff ( 1 file changed, 6 insertions(+))
google-beta provider: Diff ( 1 file changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
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.

google provider: Diff ( 1 file changed, 6 insertions(+))
google-beta provider: Diff ( 1 file changed, 6 insertions(+))

@NickElliot
Copy link
Copy Markdown
Contributor Author

brought the swap into this PR since it already has an opt-in gate via project, no reason for this change to be seperate due to the lack of diffs.

@modular-magician
Copy link
Copy Markdown
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.

google provider: Diff ( 1 file changed, 6 insertions(+))
google-beta provider: Diff ( 1 file changed, 6 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

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

@modular-magician
Copy link
Copy Markdown
Collaborator

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

@modular-magician
Copy link
Copy Markdown
Collaborator

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

@modular-magician
Copy link
Copy Markdown
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.

google provider: Diff ( 1 file changed, 5 insertions(+))
google-beta provider: Diff ( 1 file changed, 5 insertions(+))

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 5987
Passed tests: 5339
Skipped tests: 633
Affected tests: 15

Click here to see the affected service packages

All service packages are affected

Action taken

Found 15 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccAccessContextManager__service_perimeter_dry_run_egress_policy
  • TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy
  • TestAccComputeNetwork_bgpModeAndMedInteractions
  • TestAccComputeNetwork_networkBgpStandardModeDeleteMed
  • TestAccComputeNetwork_networkBgpStandardModeDeleteMedExample
  • TestAccContainerCluster_autoprovisioningDefaultsManagement
  • TestAccContainerCluster_autoprovisioningDefaultsUpgradeSettings
  • TestAccContainerCluster_autoprovisioningLocations
  • TestAccContainerCluster_nodeAutoprovisioning
  • TestAccContainerCluster_nodeAutoprovisioningDefaults
  • TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskSizeGb
  • TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskType
  • TestAccContainerCluster_withAutoscalingProfile
  • TestAccContainerCluster_withDefaultComputeClassEnabled
  • TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccAccessContextManager__access_level [Debug log]
TestAccAccessContextManager__access_level_condition [Debug log]
TestAccAccessContextManager__access_level_custom [Debug log]
TestAccAccessContextManager__access_level_full [Debug log]
TestAccAccessContextManager__access_levels [Debug log]
TestAccAccessContextManager__access_policy [Debug log]
TestAccAccessContextManager__access_policy_scoped [Debug log]
TestAccAccessContextManager__authorized_orgs_desc [Debug log]
TestAccAccessContextManager__service_perimeter [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Debug log]
TestAccAccessContextManager__service_perimeter_update [Debug log]
TestAccAccessContextManager__service_perimeters [Debug log]
TestAccComputeNetwork_bgpModeAndMedInteractions [Debug log]
TestAccComputeNetwork_networkBgpStandardModeDeleteMed [Debug log]
TestAccComputeNetwork_networkBgpStandardModeDeleteMedExample [Debug log]
TestAccContainerCluster_autoprovisioningDefaultsManagement [Debug log]
TestAccContainerCluster_autoprovisioningDefaultsUpgradeSettings [Debug log]
TestAccContainerCluster_autoprovisioningLocations [Debug log]
TestAccContainerCluster_nodeAutoprovisioning [Debug log]
TestAccContainerCluster_nodeAutoprovisioningDefaults [Debug log]
TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskSizeGb [Debug log]
TestAccContainerCluster_nodeAutoprovisioningDefaultsDiskType [Debug log]
TestAccContainerCluster_withAutoscalingProfile [Debug log]
TestAccContainerCluster_withDefaultComputeClassEnabled [Debug log]

🔴 Tests failed when rerunning REPLAYING mode:
TestAccAccessContextManager__service_perimeter_dry_run_egress_policy [Error message] [Debug log]
TestAccAccessContextManager__service_perimeter_dry_run_ingress_policy [Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


🔴 Tests failed during RECORDING mode:
TestAccDiscoveryEngineSearchEngine_discoveryengineSearchengineBasicExample_update [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link
Copy Markdown
Member

@c2thorn c2thorn left a comment

Choose a reason for hiding this comment

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

LGTM, acknowledging interim flag states

// deletion_policy is a universal virtual attribute for managing the behavior of resources when a delete is attempted
// in Terraform. Because it is a virtual attribute, it needs to be excluded from these ImportStateVerifys.
if s.ImportStateVerify && !slices.Contains(s.ImportStateVerifyIgnore, "deletion_policy") {
s.ImportStateVerifyIgnore = append(s.ImportStateVerifyIgnore, "deletion_policy")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's no harm in adding appending this, even if there's no deletion_policy field? I guess that's what we are already doing for labels?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't believe so from the quick testing I did but I'll reverify toward the end. Worst case it does entail the excess of manual test updates.

@NickElliot NickElliot merged commit 592fb27 into GoogleCloudPlatform:FEATURE-BRANCH-universal-deletion-policy Feb 4, 2026
30 of 31 checks passed
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.

3 participants