Skip to content

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 error The 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 nullify mirror_user_id using dependent: :nullify or something. Maybe we should nullify it and set mirror to false? From the Users::DestroyService, that could be Project.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

Screen_Shot_2018-03-07_at_10.35.43

Plain text email

Screen_Shot_2018-03-07_at_10.35.48

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)

Edited by Tiago Botelho

Merge request reports