Skip to content

Limited capacity workers for dormant member removal

What does this MR do and why?

As part of &7533, we are introducing a feature that allows customers to have dormant members automatically removed from their namespace's hierarchy.

Customers can set a dormancy period that qualifies for user removal (defaults to 90 days), i.e. "remove users from my hierarchy who have not been active within it for the last N days".

Activity tracking has been handled previously and is stored in the subscriptions_seat_assignments table / GitlabSubscriptions::SeatAssignment model.

This MR introduces the workers needed to actually remove the dormant members, which it does by:

  1. Finds root namespaces that:
    1. have the feature enabled
    2. have not been processed in the last ~24 hours
  2. For each namespace, find and schedule the removal of any dormant users
  3. Updating the namespace's last_dormant_member_review_at timestamp so that they do not get picked up by 1 again until the following day.

Refs #461340 (closed), #460840 (closed)

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.

Edited by Vijay Hawoldar

Merge request reports

Loading