Resolve "User::DestroyService should cleanup projects where user is mirror_user"
Taken from the Issue description
From @DouweM comment in https://gitlab.com/gitlab-com/infrastructure/issues/3118#note_45260621:
81 have validation error
["Mirror user can't be blank"]
and import errorThe mirror user is not allowed to push code to all branches on this project.
All 81 have a mirror user that no longer exists
These should have their mirror_user
unset, and we should investigate how projects can get in this state.
From @DouweM comment in https://gitlab.com/gitlab-com/infrastructure/issues/3118#note_45346274:
What do we actually want to do with a mirror project when its
mirror_user
gets deleted? Right now we're tripping over this validation, which we'd also get if we were to nullifymirror_user_id
usingdependent: :nullify
or something. Maybe we should nullify it and setmirror
tofalse
? From theUsers::DestroyService
, that could beProject.where(mirror_user: user).update_all(mirror: false, mirror_user_id: nil)
. If possible, we should also set an import error to tell them why the mirror feature got disabled.
Screenshots
HTML email
Plain text email
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Backport relevant changes to CE -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered -
If paid feature, have we considered GitLab.com plan and how it works for groups and is there a design for promoting it to users who aren't on the correct plan -
End-to-end tests pass ( package-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #3892 (closed)