Skip to content

Support disabled deletion section in group/project settings

Depends on Add the allow_immediate_namespaces_deletion app... (!205554 - merged).

What does this MR do and why?

This change replaces a feature flag system with a new application setting to control when users can immediately delete groups and projects that are scheduled for deletion.

Previously, there was a feature flag called disallow_immediate_deletion that could prevent users from bypassing the normal deletion delay period. Now, there's a new instance-wide setting called "allow immediate namespaces deletion" that administrators can configure.

The key improvements include:

  • Administrators can now control this behavior through the admin settings interface instead of feature flags
  • The UI now shows clearer messages and links to docs when immediate deletion is not available
  • The system now checks if parent groups are also scheduled for deletion, which can block immediate deletion of child items
  • Administrators always retain the ability to immediately delete items regardless of the setting

The default behavior allows immediate deletion on self-managed instances, but the setting is disabled on GitLab.com and GitLab Dedicated. This gives organizations more control over their deletion policies while providing better user experience through clearer messaging about what actions are available and why certain restrictions exist.

The feature is behind by the allow_immediate_namespaces_deletion feature flag. Documentation has been updated to explain the new setting, and tests have been added to verify the functionality works correctly.

References

Screenshots or screen recordings

As an admin

State Screenshot
Group Screenshot_2025-10-06_at_9.11.41_AM
Group pending deletion Screenshot_2025-10-06_at_9.12.12_AM
Subgroup with parent pending deletion Screenshot_2025-10-06_at_9.12.37_AM
Project Screenshot_2025-10-06_at_9.13.13_AM
Project pending deletion Screenshot_2025-10-06_at_9.13.39_AM
Project with parent pending deletion Screenshot_2025-10-06_at_9.14.17_AM

As an owner of a group/project

State Screenshot
Group Screenshot_2025-10-06_at_9.11.41_AM
Subgroup with parent pending deletion Screenshot_2025-10-06_at_9.12.37_AM
Project Screenshot_2025-10-06_at_9.13.13_AM
Project with parent pending deletion Screenshot_2025-10-06_at_9.14.17_AM

When allow_immediate_namespaces_deletion feature flag is enabled and Immediate deletion setting is disabled

State Screenshot
Group pending deletion Screenshot_2025-10-14_at_11.10.48_AM
Project pending deletion Screenshot_2025-10-14_at_11.12.21_AM

When allow_immediate_namespaces_deletion feature flag is enabled and Immediate deletion setting is enabled

State Screenshot
Group pending deletion Screenshot_2025-10-06_at_9.20.03_AM
Project pending deletion Screenshot_2025-10-06_at_9.19.31_AM

When allow_immediate_namespaces_deletion feature flag is disabled

State Screenshot
Group pending deletion Screenshot_2025-10-06_at_9.22.34_AM
Project pending deletion Screenshot_2025-10-06_at_9.22.20_AM

How to set up and validate locally

  1. In /rails/features enable the allow_immediate_namespaces_deletion feature flag
  2. Open Rails console - bin/rails console
  3. Run ApplicationSetting.first.update!(allow_immediate_namespaces_deletion: false)
  4. Create a group
  5. Create a subgroup and project in that group
  6. Add a user as an owner to the top level group
  7. Go to /admin/users and search for the user you just added as an owner
  8. Impersonate the user (button in top right corner)
  9. Go to group -> Settings -> General -> Advanced
  10. Delete the group
  11. You should not be able to delete the group immediately
  12. Go to the subgroup and project, you should not be able to delete either immediately
  13. Restore the top level group
  14. Go to the project -> Settings -> General -> advanced
  15. Delete the project
  16. You should not be able to delete the project immediately

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 Peter Hegman

Merge request reports

Loading