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
- Being added in !205556 (merged)
- 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
- Related to Support disabled state in group/project settings (#570696)
- Part of Introduce a new "Allow immediate deletion" appl... (#569453)
Screenshots or screen recordings
As an admin
State | Screenshot |
---|---|
Group | ![]() |
Group pending deletion | ![]() |
Subgroup with parent pending deletion | ![]() |
Project | ![]() |
Project pending deletion | ![]() |
Project with parent pending deletion | ![]() |
As an owner of a group/project
State | Screenshot |
---|---|
Group | ![]() |
Subgroup with parent pending deletion | ![]() |
Project | ![]() |
Project with parent pending deletion | ![]() |
allow_immediate_namespaces_deletion
feature flag is enabled and Immediate deletion
setting is disabled
When State | Screenshot |
---|---|
Group pending deletion | ![]() |
Project pending deletion | ![]() |
allow_immediate_namespaces_deletion
feature flag is enabled and Immediate deletion
setting is enabled
When State | Screenshot |
---|---|
Group pending deletion | ![]() |
Project pending deletion | ![]() |
allow_immediate_namespaces_deletion
feature flag is disabled
When State | Screenshot |
---|---|
Group pending deletion | ![]() |
Project pending deletion | ![]() |
How to set up and validate locally
- In
/rails/features
enable theallow_immediate_namespaces_deletion
feature flag - Open Rails console -
bin/rails console
- Run
ApplicationSetting.first.update!(allow_immediate_namespaces_deletion: false)
- Create a group
- Create a subgroup and project in that group
- Add a user as an owner to the top level group
- Go to
/admin/users
and search for the user you just added as an owner - Impersonate the user (button in top right corner)
- Go to group -> Settings -> General -> Advanced
- Delete the group
- You should not be able to delete the group immediately
- Go to the subgroup and project, you should not be able to delete either immediately
- Restore the top level group
- Go to the project -> Settings -> General -> advanced
- Delete the project
- 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.