pronto icon indicating copy to clipboard operation
pronto copied to clipboard

Comments are lost on outdated diffs even when the comment is still relevant.

Open SteveHanna opened this issue 7 years ago • 3 comments

In a Github PR, if a line that has been commented by pronto is changed, the comment will become outdated and no longer visible when looking at the 'files changed'.

When pronto is deciding if it should add a comment to the PR, it checks if a comment already exists. If a comment already exists at that line, it won't add it.

However, It could also check if the code at that line has changed and decide to re-add the same comment if necessary.

Not sure if this is too specific to github but it's unfortunate that comments get lost when code is changed even though the comment may still be relevant.

SteveHanna avatar Jul 18 '16 00:07 SteveHanna

@SteveHanna 👍

Fully support the idea. Ideally, GitHub would just provide outdated flag via their API that we could use. Alas, that's not the case and we'll need to do a bit more work to recognise outdated comments.

For reference: https://developer.github.com/v3/pulls/comments/#list-comments-on-a-pull-request

mmozuras avatar Jul 31 '16 12:07 mmozuras

+1

laurenbrandstein avatar Apr 30 '18 22:04 laurenbrandstein

I'm looking into implementing this, since some of our PRs get very polluted and messy. I only checked GitHub API, but it seems that comments that are outdated are easily recognizable by position == nil && position != original_position. I think that'd be a good start; I hope both bitbucket and gitlab have something similar.

For comments that are not on line originally, it's easy as well since those cannot get outdated by line change.

This would also require us saving the comment_id in the Comment class and passing that around so that we know which comments to delete when the time comes.

gyfis avatar Mar 26 '19 14:03 gyfis