Skip to content

Changes dormant user setting: default value and validation

Chase Southard requested to merge ninety_days_for_deactivation into master

What does this MR do and why?

Describe in detail what your merge request does and why.

This MR enforces a minimum inactivity limit of 90 days before users are considered dormant and their accounts disabled via automation. This minimum ensures a good user experience and compliance with GitLab billing policies. A recent change (!95496 (merged)) allowed this feature to set a configurable limit, but did not set the minimum threshold of 90 days.

See the discussion in this high priority issue Set a minimum number of days for automatic deac... (#375494 - closed) where we need to land these changes quickly before code freeze of the 15.5 milestone to repair the usability and appropriate function of the Dormant users application setting for self-managed instances by requiring a minimum number for the deactivate_dormant_users_period application setting.

This attempts to make that change in the most boring way possible - updating form field options with a min: 90, step: 1, setting validation for existing values, and a data migration to update and self-managed instance settings to be at least that minimum value.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before

Screen_Shot_2022-10-12_at_19.20.56

After

Screen_Shot_2022-10-12_at_15.22.03

Screen_Shot_2022-10-12_at_15.24.53

Screen_Shot_2022-10-12_at_19.50.46

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. visit: http://your-gdk-instance:3000/admin/application_settings/general#js-account-settings
  2. enable the Dormant users setting
  3. adjust the value to some number above 90 and save

No other behavior has intentionally changed only the minimum value for this setting.

Database query and plan

Query

update application_settings set deactivate_dormant_users_period=90 where deactivate_dormant_users_period < 90

Query Plan

ModifyTable on public.application_settings  (cost=0.00..4.01 rows=1 width=4413) (actual time=1.219..1.220 rows=0 loops=1)
   Buffers: shared read=1
   I/O Timings: read=1.177 write=0.000
   ->  Seq Scan on public.application_settings  (cost=0.00..4.01 rows=1 width=4413) (actual time=1.216..1.217 rows=0 loops=1)
         Filter: (application_settings.deactivate_dormant_users_period < 90)
         Rows Removed by Filter: 1
         Buffers: shared read=1
         I/O Timings: read=1.177 write=0.000
local

EXPLAIN ANALYZE update application_settings set deactivate_dormant_users_period=90 where deactivate_dormant_users_period < 90

[["Update on application_settings (cost=0.00..1.01 rows=1 width=12086) (actual time=0.032..0.033 rows=0 loops=1)"], [" -> Seq Scan on application_settings (cost=0.00..1.01 rows=1 width=12086) (actual time=0.032..0.032 rows=0 loops=1)"], [" Filter: (deactivate_dormant_users_period < 90)"], [" Rows Removed by Filter: 1"], ["Planning Time: 0.344 ms"], ["Execution Time: 0.189 ms"]]

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Omar Fernandez

Merge request reports