Re-enable legacy diff notes on merge request diffs
What does this MR do?
This updates the logic in the diff store to allow for LegacyDiffNote
to be shown on the changes tab. LegacyDiffNotes
don't have a position
object, instead they only have a line_code
string. If the note has the position
, then the logic remains the same as previous. If the position
object does not exist, then the line codes get compared.
As an extra on top of this, it also re-enables commenting on legacy diffs. Previously we would only send DiffNote
as the type to the backend, which for legacy diffs it is incorrect. Instead we now check if it is a legacy diff and then send the correct type (LegacyDiffNote
or DiffNote
).
What are the relevant issue numbers?
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/48873
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Filipa Lacerda