Skip to content

backend: Disallow immediate deletion behind :disallow_immediate_deletion FF

What does this MR do and why?

This change introduces a new safety feature that prevents users from immediately deleting projects and groups. Previously, users could bypass the normal deletion process (which includes a waiting period) and delete items right away. Now, there's a new feature flag called disallow_immediate_deletion that, when enabled, blocks this immediate deletion capability.

The changes affect both the user interface and the backend systems:

  • In the web interface, the "delete immediately" buttons and options are hidden when the feature flag is active
  • In the API, requests to immediately delete projects or groups will return an error message explaining the feature is no longer available
  • The backend controllers now check for this feature flag and deny access to immediate deletion when it's enabled

The feature flag is currently disabled by default, meaning the immediate deletion functionality still works as before. However, administrators can enable this flag to enforce a safer deletion process that requires users to wait through the standard deletion period rather than allowing instant removal of projects and groups.

This is a risk-reduction measure, likely implemented to prevent accidental or hasty deletions of important projects and groups by requiring users to go through the standard deletion workflow with its built-in waiting period.

Related work:

References

  • Related to #561680+s

Screenshots or screen recordings

Resource Before After
Group settings Screenshot_2025-08-19_at_18.28.16 Screenshot_2025-08-19_at_16.54.52
Project settings Screenshot_2025-08-19_at_18.27.52 Screenshot_2025-08-19_at_18.27.09

How to set up and validate locally

  1. Enable the disallow_immediate_deletion feature flag.
  2. Visit a group Settings page
  3. Visit a project Settings page

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.

Edited by Rémy Coutable

Merge request reports

Loading