Prevent deletion of project_bot users with non-expiring access tokens
What does this MR do and why?
In #471683 (closed) we implemented cron worker ResourceAccessTokens::InactiveTokensDeletionCronWorker that deletes project_bot users whose all tokens became inactive more than 30 days ago or without tokens.
#521001 (closed) reported that for GitLab Self-Managed instances that disabled require_personal_access_token_expiry setting and use non-expiring access tokens, the cron worker deletes non-expiring project/group access tokens and related project_bot users.
This MR resolves this issue and amends existing test related to the cron worker to confirm the fix and prevent regression in the future.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
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.