Add Project Avatar & Group Uploads to GitLab Migration
What does this MR do and why?
Related to #339416 (closed)
bulk_import_projects feature flag that is currently off by default (and disabled on .com).
This MR adds Project Avatar & Group Uploads migration when using Group Migration that includes projects (https://docs.gitlab.com/ee/user/group/import/).
The original intend of this MR was to introduce a similar pipeline to GroupAvatarPipeline in order to migrate just project avatar, but because of GitLab API inconsistency it's harder to retrieve project avatar of a project, compared to group. It is possible to retrieve group avatar binary using api/v4/groups/.../avatar but there is no such endpoint for projects.
Because we already export avatar as part of UploadsPipeline and ignore it, instead we can import avatar as part of UploadsPipeline, add Group uploads migration and remove GroupAvatarPipeline altogether. This way when we migrate uploads we migrate avatar as well.
Screenshots or screen recordings
How to set up and validate locally
-
Feature.enable(:bulk_import). -
Feature.enable(:bulk_import_projects). - Create a top level group and project in it.
- Create project and group uploads in both group and project. Upload group and project avatars.
- Go to
/groups/new#import-group-panepage and enter instance url and access token (needs to beapi&read_repositoryscope). - Select newly created group and click Import.
- Wait for Group import to complete and verify imported uploads & avatars. They should be present.
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.