Skip to content

Fix GitHub PR comments are out of order after import

Tetiana Zavediuk requested to merge tz-383539-comment-threads-out-of-order into master

What does this MR do and why?

We process diff notes from GitHub in ID order. We have to calculate the discussion_id for each of diff note in the same order. So here we create and cache the discussion_id for all diff notes before they are imported to GitLab. This way we'll be sure that all diff notes related to the same thread will have the same discussion_id.

It fixes GitHub PR comment threads not imported correctly.

Screenshots or screen recordings

Result of importing the repository with pull request comments before applying the fix:

before_copy

After applying the fix:

after_copy

How to set up and validate locally

  1. Import this public repo https://github.com/99designs/dddk to GitLab via our API
  2. Go to the MR # 11 (/dddk/-/merge_requests/11) page
  3. Ensure all the comments are listed in one thread in the correct order (compare with the original page)

MR acceptance checklist

Edited by Tetiana Zavediuk

Merge request reports

Loading