[BE] Implement upper limit for dormant period

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).

We will allow the time period to be customised by users, with a minimum of 90 days (implemented in #461334 (closed)).

Purpose

With users being able to modify the dormant period, we should implement an upper limit on what that period can be, to prevent any problems.

  • Implement an upper limit on the NamespaceSetting#remove_dormant_members_period
  • Initially we will go with an upper limit of 5 years (see: #505977 (comment 2225984468))

Considerations

The column is as-yet un-used, so all records in the DB will have the default value of 90, so implementing validation etc. should have no impact, but if that changes before this issue is picked up, we need to consider that we might invalidate any existing records.

We already have docs for this feature so we should consider updating them: #505977 (comment 2225988761)

Edited by Vijay Hawoldar