[BE] Add dormant member setting to Groups

Background

In [Gitlab.com] Automatic removal of dormant members (&7533) we intend to add a feature to identify and remove dormant users from Namespaces for GitLab.com

This is similar to the existing SM feature ( &5519 (closed)), but rather than deactivating users, we will remove members.

To achieve this, we will be adding a way to track member’s last activity timestamp within a namespace, so that we can identify dormant members and remove them if they've been dormant for greater than a predefined time period (e.g. 90 days).

Purpose

The purpose of this issue is to:

Add a toggle-able setting to group Namespaces that can be updated via a group setting ([FE] Add dormant member Group setting (#461339 - closed))

  • Create a migration to add an integer column to the namespace_settings table, e.g. remove_dormant_members_period
    • We should consider a second column, remove_dormant_members as a boolean. CONFIRM: we should confirm the UX plan to lead this decision - i.e. if clearing the period disables the setting, or if there are two to update
    • Relevant discussion: !153118 (comment 1909368079)
  • Validate values:
    • minimum 90 day period
    • root namespaces only

Implementation

Edited by Sheldon Led