Paid namespace members can delete their own user record without delay
What does this MR do and why?
Resolves https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/385
This MR adds an exception to users under paid namespaces (excluding trials) for delayed own-user account deletion introduced by https://gitlab.com/gitlab-org/gitlab/-/issues/409025+.
With the changes in this MR, there will be no 7-day delay when a user under a paid namespace deletes their own account.
How to set up and validate locally
- Start GDK in SAAS mode (
GITLAB_SIMULATE_SAAS=1 gdk start
) - Turn on the feature flag
$ rails console > Feature.enable(:delay_delete_own_user)
- Create a new user (
user_a
) and a group (paid_group
) - Create an ultimate plan subscription for the new group
$ rails console > GitlabSubscription.find_by(namespace_id: <paid_group.id>).destroy # delete existing subscription if there is one > FactoryBot.create(:gitlab_subscription, :ultimate, namespace: Group.find(<paid_group.id>))
- Create another new user (
user_b
) to delete - Login with
user_a
then adduser_b
to the group as a Reporter/Developer/Maintainer (as long as role is not Guest) - Login with
user_b
, go tohttp://localhost:3000/-/profile/account
then delete the account - Validate that
user_b
is deleted a few minutes later instead after 7 days
> User.find(<user_a.id>)
=> nil
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 Eugie Limpin