Skip to content

Follow-up on Resolve "gitlab-rake gitlab:import:repos schedules an import"

From the discussion here: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16115#note_53188047

We've been adding a new import_type bare_repository to use on the repo import task, and workaround some of the issues we encountered on project/create_service.rb (such as overwriting a repository).

This is not following the pattern of an import and it doesn't have an import class, we should consider refactoring this to at least:

  1. Treat the rake task as an import and use the rest of the fields such as import_status
  2. Refactor project/create_service.rb, where the branch-complexity and method length is too high, and perhaps use inheritance or delegation to better distinguish the different types of imports.

At the moment import? returns true for bare_repository, meaning that it's easy to add a new condition in project/create_service.rb that may cause a bug in the rake task, due to the different approach of moving the .git repositories to the storage, and not creating anything there.

/cc @DouweM

OSZAR »