ReviewBot: comment_write(): include target in debug message when too similar.
This commit is contained in:
parent
737273c38f
commit
9443c3de04
@ -446,15 +446,16 @@ class ReviewBot(object):
|
||||
|
||||
comments = self.comment_api.get_comments(**kwargs)
|
||||
comment, _ = self.comment_api.comment_find(comments, self.bot_name, info)
|
||||
debug_key = '/'.join(kwargs.values())
|
||||
if (comment is not None and
|
||||
((identical and comment['comment'] == message) or
|
||||
(not identical and comment['comment'].count('\n') == message.count('\n')))
|
||||
):
|
||||
# Assume same state/result and number of lines in message is duplicate.
|
||||
self.logger.debug('previous comment too similar to bother commenting again')
|
||||
self.logger.debug('previous comment on {} too similar'.format(debug_key))
|
||||
return
|
||||
|
||||
self.logger.debug('adding comment to {}: {}'.format('/'.join(kwargs.values()), message))
|
||||
self.logger.debug('adding comment to {}: {}'.format(debug_key, message))
|
||||
|
||||
if not self.dryrun:
|
||||
if comment is None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user