pronto icon indicating copy to clipboard operation
pronto copied to clipboard

Delete fixed comments

Open marvin-bitterlich opened this issue 8 years ago • 3 comments

One thing that happens on big pull requests is that there are many old comments made by pronto.

image

Would it be possible to add an option to delete old comments made by the bot before new ones are made? This means existing issues are reported again but fixed issues are gone.

marvin-bitterlich avatar Jul 29 '17 14:07 marvin-bitterlich

@Kostronor I'd accept a pull request adding such behavior. Or would write it one day myself. I would expect it to be optimized to minimize the numbers of requests. Meaning to delete unnecessary comments and do not repost old ones.

mmozuras avatar Aug 15 '17 14:08 mmozuras

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

On hound, the way it test is:

  1. User who comment is bot
  2. line number & message is equal

https://github.com/houndci/hound/blob/fe43c074728438cae520d4f14d36926206200d2e/app/policies/commenting_policy.rb#L22

bekicot avatar Jul 21 '21 01:07 bekicot