Changes dormant user setting: default value and validation
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
After
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- visit:
http://your-gdk-instance:3000/admin/application_settings/general#js-account-settings
- enable the
Dormant users
setting - 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.
-
I have evaluated the MR acceptance checklist for this MR.