Store detailed import status in DB
Problem
Currently we do not provide exact feedback to the user on finished import process. We show how many entities were imported, but we don't provide which entities exactly were not successfully imported. We also do not show errors that prevented entities to get imported or cause the general failure of the import (when project was not created or repository imported).
It's difficult for the user to decide, if they are satisfied with the import or would rather repeat it.
It's impossible for user to know the cause of the failures (the errors).
Proposed solution
Ultimately we should show to the user:
- general end state of import: Completed, Partially completed, Failed, Cancelled
- for Partially completed state
- overall number of imported vs not imported entities (that's what we have now)
- exactly which entities were not imported (as in which PRs exactly, for example), if possible provide a direct link to that entity on GitHub
- errors related to entities not getting imported, protected branches rules not translated, attachments not migrated, etc. so user (and ourselves) have more information to troubleshoot/debug
- for Failed state - show error(s) that prevented project from being created, or the repository from being migrated.
In this issue, we want to store in DB detailed import status:
- Entities that were not imported and links to those entities, when possible. If providing an exact link is not possible (e.g branch protection rule) - link to most relevant resource.
- Errors that caused the entities to not get migrated, or the project to not get created at all, in relation to entity they relate to. We want to store unique values only since some errors can be duplicated due to job retries.
This is to enable to show later to the user:
- Which entities failed to be imported, with links and errors that caused those entities to not get migrated. This is in case of Partially completed state
- In case of Failed state - show error(s) that caused the project to not get created at all.
Technical details
There probably might be the case, when after retries the item was successfully imported, which means we have to collect errors on the last retry or when retries were exhausted, to make sure we are not collecting falsy negative results