Skip to content

Run model validations base data importer

What does this MR do and why?

Implementation of Run model validations when importing from GitHub

Some GitHub Importers use .legacy_bulk_import to insert without any validations/callbacks. We cannot replace it BulkInsertSafe since it doesn't support callbacks that fire per each record being inserted.

LabelsImporter, MilestonesImporter and ReleasesImporter imports items in bulk and used shared BulkImporting, so the validation check was added there. In case if the record is not valid we log and skip importing.

DiffNoteImporter, IssueImporter, PullRequestImporter and NoteImporter import just one record but we still use .legacy_bulk_import to prevent any callbacks from being called. So for these types validation is called directly in the importers.

IssueAssignee also inserted via .legacy_bulk_import, validation is skipped since we are not inserting user input in this case.

Since LabelLinks already supports BulkInsertSafe we can use it in LabelLinksImporter

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rodrigo Tomonari

Merge request reports

Loading