Skip to content

Github Importer - Add logs to the import process

Kassio Borges requested to merge kassio/add-github-importer-logs into master

What does this MR do?

related to: #288335 (closed)

Currently is very hard to debug a Github Import. To make this process easier this I propose to add info and error logs to the Github import process.

Screenshots (strongly suggested)

Example
{"severity":"INFO","time":"2020-11-27T17:45:15.677Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting stage","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportRepositoryWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:15.684Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","importer":"Importer::RepositoryImporter","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportRepositoryWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:19.330Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"stage finished","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportRepositoryWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:19.535Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting stage","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportBaseDataWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:19.541Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","importer":"Gitlab::GithubImport::Importer::LabelsImporter","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportBaseDataWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.158Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","importer":"Gitlab::GithubImport::Importer::MilestonesImporter","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportBaseDataWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.395Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","importer":"Gitlab::GithubImport::Importer::ReleasesImporter","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportBaseDataWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.643Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"stage finished","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportBaseDataWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.827Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting stage","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportPullRequestsWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.834Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","importer":"Importer::PullRequestsImporter","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportPullRequestsWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:20.834Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter","parallel":true}
{"severity":"INFO","time":"2020-11-27T17:45:21.501Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"importer finished","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter","parallel":true}
{"severity":"INFO","time":"2020-11-27T17:45:21.505Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"stage finished","import_source":"github","project_id":200,"stage":"Gitlab::GithubImport::Stage::ImportPullRequestsWorker"}
{"severity":"INFO","time":"2020-11-27T17:45:21.985Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}
{"severity":"INFO","time":"2020-11-27T17:45:22.137Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}
{"severity":"INFO","time":"2020-11-27T17:45:22.184Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"starting importer","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}
{"severity":"INFO","time":"2020-11-27T17:45:22.847Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"importer finished","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}
{"severity":"INFO","time":"2020-11-27T17:45:22.863Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"importer finished","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}
{"severity":"INFO","time":"2020-11-27T17:45:22.885Z","correlation_id":"01ER5CY6M62BHTMYME8B4ADZEA","message":"importer finished","import_source":"github","project_id":200,"importer":"Gitlab::GithubImport::Importer::PullRequestImporter"}

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Kassio Borges

Merge request reports