GitHub import jobs cannot be retried
GitHub import jobs can take many minutes to finish, depending on the size of the repo being imported. These jobs can be halted for reasons like Sidekiq being taken down (high memory, deploy, ...), so they'll be re-enqueued by Sidekiq, that's when we face two problems:
Projects::ImportServicewill try to import the repo first (via
git clone) through gitlab-shell, which will see that the repo already exists on the file system (thanks to the first halted job) and return status 1 silently, which eventually is considered an error by
ImportServiceand stops after reporting a misleading error message like "Error importing repository blah into blah".
- With 1 fixed, we will start importing data from the beginning with no consideration to what have been imported before, which may or may not be caught due to validation. So we need to make the data importing aware of any existing data.
Related to !6552 (merged)