Automatic user deactivation isn't logged to Audit events
Summary
In 16.0 we added user deactivate service that logs user deactivation events to Audit events.
However, we do not use this service for automatic dormant user deactivation which leads to these events not getting logged to audit events.
Steps to reproduce
- Make sure have a user that is dormant on your GitLab instance.
- Enable Automatic deactivation of dormant users.
- Run
Users::DeactivateDormantUsersWorker.new.performworker through Rails console. - The dormant user should get deactivated, but you won't see the deactivation event logged to Audit events
Example Project
Not reproducible on GitLab.com
What is the current bug behavior?
No log of user deactivation
What is the expected correct behavior?
We should log user deactivation when it is done automatically as well.
Possible fixes
Use Users::DeactivateService service in automatic dormant user deactivation worker.
cc @s_shaik
Edited by Kate Grechishkina