Project soft delete should only occur if soft delete is enabled
Problem to solve
GitLab 12.6 introduced soft deletion of projects for Silver/Premium and higher tiers. In those tiers the "remove project" flow only schedules a project for deletion after a period of time (the default is 7 days). Currently in those tiers it is not possible to delete projects immediately. This has resulted in a some complaints (in order of oldest to newest):
- Immediately remove a soft-deleted project
- "Is there any way to avoid this entirely in the case that confidential info has been posted on the repo?"
- "it was quite frustrating to have the "deleted" items persisting for 7 days" (GitLab reporter)
- "I discovered [delete] is not readily possible on Gitlab while the fork is pending deletion."
- "I do not see an easy way of forcing the deletion before the pending date."
- "This has an impact for all users of Terraform and Pulumi"
- Removing a fork should not take one week
- API project DELETE backwards incompatible change
- There should be a group-level configuration option to "Enable delayed project removal", with explanation text: "Projects will be permanently deleted after a 7-day waiting period. This period can be customized by an admin in instance settings."
- Projects should not be soft deleted on removal unless that option is enabled.
- The project removal confirmation modal should say: ""This group has enabled a project deletion delay. Your project will be recoverable for
- The "Removed projects" tab should only appear if that option is enabled.
- The API documentation to remove a project should note there will be a delay if that option is enabled.
- Projects under user namespaces to be deleted immediately
Permissions and security
No change to existing permissions. Only Group owners are able to change group configuration, and only Project owners are able to delete projects.
What does success look like?
Project soft delete only occurs when the configuration option has been enabled at the group level.