`Github::Import#execute` should return `false` if any errors occurred
Currently, errors that happen during Github::Import#execute
are saved in projects.import_error
at the end of the import, and then we return true
, unless a Github::RepositoryFetchError
exception was raised.
Right now we just call project.import_finish
in the case Github::Import#execute
returns true
:
- In
RepositoryImportWorker#perform
- In the
github:import
task
Unfortunatly, we clear project.import_error
in this case:
- https://gitlab.com/gitlab-org/gitlab-ce/blob/67d3ddfdb681d4e791b3b3b716d2b772f530cc86/app/models/project.rb#L377
- https://gitlab.com/gitlab-org/gitlab-ce/blob/67d3ddfdb681d4e791b3b3b716d2b772f530cc86/app/models/project.rb#L568
I think the solutions is that if any errors are detected (i.e. errors.any?
), we should return false
since the import isn't successful. That would mark projects.import_status
as import_failed
which is accurate, and project.import_error
would still be present for further investigation