Fix Admin Mode bug in DeactivateDormantUsersWorker
What does this MR do and why?
This MR updates the DeactivateDormantUsersWorker Sidekiq cron job to skip authorization for the Users::DeactivateService
. Without this, enabling admin mode will cause the DeactivateDormantUsersWorker sidekiq cron to silently fail.
Fixes: #431560 (closed)
How to set up and validate locally
- Be running at least GitLab 16.3.
- Enable Admin Mode
- Create a dormant user
- Manually execute the dormant workers cron from the Admin interface
To force a user to qualify for deactivation:
user = <id> # pick a user to make dormant and ready for deactivation
last_active = Gitlab::CurrentSettings.deactivate_dormant_users_period.days.ago.to_date - 1
user.last_activity_on = last_active
user.last_sign_in_at = last_active
user.current_sign_in_at = last_active
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.
Edited by Josianne Hyson