Skip to content

Draft: Fix single note import bug

Jessie Young requested to merge jy-bulk-import-docs-debug into master

What does this MR do and why?

  • Previously, we had an issue whose notes were not imorting properly: https://gitlab.com/gitlab-migration-large-import-test/migration-test-project/-/issues/618
  • The "changed description" note was not being imported when this project was imported via Direct Transfer. Other issues with the same comment were being imported, so it wasn't clear why this one was being skipped.
  • Using binding.pry_shell, I inspected the import logic when it got to lib/gitlab/import_export/base/relation_object_saver.rb and called the save_sublreations method.
  • In that method, the note object was there. But it was not being persisted because subrelation.size was equal to 1
  • Looking at when this MIN_RECORDS_SIZE constant was added: !79963 (merged), it seems that it was later changed with the intention of allowing collections with 1 object: !94311 (merged)
  • But the logic actually required collections with MORE than 1 object, so 2 were required. Which means that collections with 1 object failed to import.
  • Fixes #417122 (closed)

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

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Merge request reports