#744 Display comments on outdated patches
Closed: Fixed None Opened 8 years ago by lsedlar.

Alice submits a pull request to a repo. Bob finds some issues and posts inline comments. Alice fixes issues and updates the pull request (by force-pushing the same branch). The PR page now shows that Bob commented on line X, but clicking the link display current version of the patch without the comment.

It would be nice if even outdated comments were reachable somehow.

Example: https://pagure.io/rpkg/pull-request/13


I got this working by providing a small toggle button allowing to show/hide the comment in the main section of the PR.

It would probably be useful to also see the line that the comment was about and maybe some context? (or is the "line 10 of folder/readme" a link to the actual commit?

the link is not to the commit but to the comment on the "Diff" tab of the PR page, but that link gets voided if the file changes.

The proposal is good enough for me. If there was a way to display the line the comment was attached to, it would be awesome, but I expect that might not be really possible.

Alternative improvement would be change the text to something "XYZ commented on outdated patch on line 10 of folder/readme so that it's obvious the link does not point to the correct place.

Alternative improvement would be change the text to something "XYZ commented on outdated patch on line 10 of folder/readme so that it's obvious the link does not point to the correct place.

Except that I do not know in front if the files was changed since the comment was made.

Ok then, I thought this might be infeasible.

The proposal is good enough for me. If there was a way to display the line the comment was attached to, it would be awesome, but I expect that might not be really possible.

I'd like this as well but this will take some work and maybe some refactoring, I don't have in mind a way to cleanly extract the line or lines above the comment (especially if the file changed since).
Maybe the lines should be stored in the DB together with the comment, but that doesn't sound so nice.
Something to think about because it would clearly be good to have :)

As said on IRC: we could instead of the file hash store the tip of the tree (commit at the top) and the file path.
This uniquely identifies the state of the file including its changes up to that point.

I'm going to close this one for now.

The discussion for showing the context is at: https://pagure.io/pagure/issue/751

Login to comment on this ticket.

Metadata
Attachments 1