Resolve 621467:Add Terraform state deletion grace-period for feature flag

What does this MR do and why?

Implements #621467 (closed). Adds the disabled-by-default terraform_state_delayed_deletion feature flag and uses it in Terraform::States::DestroyService. When the feature flag is enabled for a project, permanent deletion is deferred while the Terraform state is still within the seven-day GRACE_PERIOD. Existing deletion behavior remains unchanged when the flag is disabled or when the grace period has elapsed.

Changes

  • Adds the terraform_state_delayed_deletion gitlab_com_derisk feature flag, disabled by default and scoped to a project actor.
  • Adds a grace-period guard in DestroyService.
  • Adds specs for:
  • flag disabled
  • flag enabled within the grace period
  • exact grace-period boundary
  • flag enabled after the grace period
  • state not marked for deletion

References

Work Item - #621467 (closed)

Epic - gitlab-org#23396

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #621467 (closed)

Merge request reports

Loading
Loading