Skip to content

GithubImporter: Format diff note suggestions to the gitlab format

Kassio Borges requested to merge kassio/github-importer-format-suggestions into master

What does this MR do and why?

Github "suggestion" feature has a different markdown format, it uses:

```suggestion
SUGGESTION
```

While Gitlab has a range in the suggestion markdown, like:

```suggestion:-0+0
SUGGESTION
```

To convert the Github format to Gitlab, in the DiffNote representation the range will be added. The range is calculated by the difference of the start_line and line when the start_line is present, which indicates a multi-line suggestion.

Related to: #340624 (closed)

This MR is just part of the solution, to make the imported diff notes with suggestions work we also have to change the importer to use the DiffNote model instead of LegacyDiffNote, which will be done in another MR.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

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.

Edited by Kassio Borges

Merge request reports