Skip to content

Introduce Group level setting for Delayed Project removal

Aishwarya Subramanian requested to merge project-soft-delete-setting into master

What does this MR do?

This MR adds a Group level Setting delayed_project_removal to configure whether Projects within the scope of the Group should be deleted after a delayed interval, or immediately.

Group admin can configure this Setting under Settings -> General -> Permissions, LFS, 2FA menu (ref screenshot below).

  • When the Setting is enabled, projects within the groups will be deleted after the delayed interval defined in Application Setting.

  • When the Setting is disabled, projects within the groups will be deleted immediately.

The Setting is disabled by default for all groups.

All user namespace projects are deleted immediately.

Feature flag

The option to let Groups to configure this Setting is gated behind the Feature flag configure_project_deletion_mode. It is disabled by default.

The enablement of the flag depends on !36461 (merged)

Test plan

Feature flag enabled? Use case Expected behavior Status
true Project in user namespace Deletes immediately
true delayed_project_removal disabled for group Deletes immediately
true delayed_project_removal enabled for group Deletes after delayed period
false Project in user namespace Deletes after delayed period
false Project in a group Deletes after delayed period

Mentions #220382 (closed)

Screenshots

Screen_Shot_2020-07-07_at_6.29.19_PM

Database output

Migration output:

== 20200701190523 AddDelayedProjectRemovalToNamespaces: migrating =============
-- add_column(:namespaces, :delayed_project_removal, :boolean, {:default=>false, :null=>false})
   -> 0.0053s
== 20200701190523 AddDelayedProjectRemovalToNamespaces: migrated (0.0089s) ====

Rollback output:

== 20200701190523 AddDelayedProjectRemovalToNamespaces: reverting =============
-- remove_column(:namespaces, :delayed_project_removal)
   -> 0.0016s
== 20200701190523 AddDelayedProjectRemovalToNamespaces: reverted (0.0084s) ====

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [-] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Mayra Cabrera

Merge request reports