Comment on any expanded diff line on MRs
What does this MR do?
Allow commenting on any expanded diff lines on merge requests by fetching and inserting the content from blobs. In general, expanded diff lines will be treated as if it was part of the diff.
TODOs
-
Create a Diff::Expander
class which receives blob, diff and position information. This class responsibility is to merge blob data with diff data given a position. Theposition
will be used to determine if it's a expanded position, then give us thesince
andto
information, which will be used to fetch the correct blob lines. -
When sending a diff comment ( DiffNote
), we'll use theDiff::Expander#diff_lines
to determine how the new diff should look like (and we'll be able to fetch thediff_line
in the process). -
backend Improve the logic to catch when the position
doesn't need an expansion at all -
backend Fix the < 20
expanded lines bug -
backend Address top diff expansion comment -
backend Address bottom diff expansion comment -
backend Address highlighting cache (possibly by refreshing upon note creation) -
backend Adjust reindex logic after blob merge with diff -
frontend Fix ...
request params when commenting in a expanded line, reloading and clicking...
-
Fix commenting on diff additions -
Fix parallel diff lines having no bottom match line -
Discover reason for }}
duplication on highlighted diffs -
Refactor the whole thing -
Add test for different comment positions on top / middle / bottom -
Address test failures
Obs: Cache being handled on https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22674.
What are the relevant issue numbers?
https://gitlab.com/gitlab-org/gitlab-ce/issues/13950
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 🤖 GitLab Bot 🤖