Fix NoMethoError on importing notes from Github

What does this MR do and why?

On the GitHub side, it is possible to leave a comment on a file (not only line Adding comments to a pull request item 7). GitLab doesn't support such notes yet (but looks like it is planned to be done in the scope of Comment on file header in merge request diff (#17120 - closed)).

This MR provides a fix to prevent the import from being failed, but it doesn't completely fix the problem. For more details !121152 (comment 1397748580)

Corresponding issue: NoMethodError: undefined method `new_pos' for n... (#334801 - closed)

Screenshots or screen recordings

Comment on a text file

Screenshot_2023-05-23_at_21.08.12

Comment on a binary file

Screenshot_2023-05-23_at_21.07.28

Comment on image

Screenshot_2023-05-23_at_21.06.55

How to set up and validate locally

  1. On the GitHub side comment on a file in the PR (GitHub documents for the reference Adding comments to a pull request)
  2. Initiate import of source project from GitHub (it can be done via UI or API)
  3. Import should finish with no error.
  4. Once it is finished check MR notes, comments that were made on a file on the GitHub side should appear

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 Kristina Doskich

Merge request reports

Loading