Skip to content
Snippets Groups Projects

Remove InvalidForeignKey rescue and add logs in GitHub Import

Merged 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

Merged results pipeline #1027032973 passed

Pipeline: GitLab

#1027037608

    Pipeline: E2E GDK

    #1027042319

      Merged results pipeline passed for 7daa8067

      Test coverage 82.48% (15.68%) from 2 jobs

      Merged by Erick BajaoErick Bajao 1 year ago (Oct 5, 2023 4:18pm UTC)

      Loading

      Pipeline #1027103170 passed

      Pipeline passed for 3ff2bb31 on master

      Test coverage 66.77% (15.68%) from 2 jobs
      10 environments impacted.

      Activity

      Filter activity
      • Approvals
      • Assignees & reviewers
      • Comments (from bots)
      • Comments (from users)
      • Commits & branches
      • Edits
      • Labels
      • Lock status
      • Mentions
      • Merge request status
      • Tracking
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      • Loading
      Please register or sign in to reply
      Loading