Fix GitHub PR comments are out of order after import
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:
After applying the fix:
How to set up and validate locally
- Import this public repo https://github.com/99designs/dddk to GitLab via our API
- Go to the MR # 11 (/dddk/-/merge_requests/11) page
- Ensure all the comments are listed in one thread in the correct order (compare with the original page)
MR acceptance checklist
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Tetiana Zavediuk