Skip to content

Remove InvalidForeignKey rescue and add logs in GitHub Import

Rodrigo Tomonari requested to merge rodrigo/add-log-to-note-importer into master

What does this MR do and why?

Raises an error when a noteable_id can't be found using GithubImport::IssuableFinder

And removes InvalidForeignKey rescues from importer classes. The rescues were added long ago, and they don't seem necessary. For example, the comment says: It's possible the project and the issue have been deleted since scheduling this job. In this case we'll just skip creating the note. Projects should be present in most cases as it is fetched before starting the importer. And users are unlikely to delete issues during a project import.

Besides, it is better to let the error be raised since a import_failure record will be created allowing users to know the record wasn't migrated.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Enabled GitHub Import in http://gdk.test:3000/admin/application_settings/general -> Visibility and access controls -> Import Sources -> GitHub Import
  2. Go to New Project
  3. Select Import
  4. Then Select GitHub
  5. Provide an access token
  6. Select the project to be imported
  7. Wait for the import to finish
  8. Check if the project was imported

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