Store GitHub Import stats in DB
What does this MR do and why?
Currently, after the GitHub import is started, we are showing the statistics of imported/fetched objects in the UI and in the API response (for the GET /projects/{id}/import
endpoint).
In this MR we store this stats in our DB after GitHub import is finished so it won't disappear when Redis key is expired.
It implements #388279 (closed).
Screenshots or screen recordings
109939-Store-GitHub-Import-stats-in-DB
How to set up and validate locally
-
Import a GitHub project to GitLab using UI (Go to New Project -> Import project -> GitHub -> click Import button) or API.
-
After import is finished, make sure
project.import_checksums
contains a hash with project import statistics:
project = Project.last
project.import_checksums
The hash must contain the same data as the cached import statistics:
::Gitlab::GithubImport::ObjectCounter.summary(project)
-
Wait 2 days or clear Redis cache.
-
Ensure that the import statistics are still displayed in the UI and in the API response for the
GET /projects/{id}/import
endpoint.
MR acceptance checklist
-
I have evaluated the MR acceptance checklist for this MR.