ReviewBot: disable comment handler for default action handler.

Otherwise, if a bot overrides __default() and still calls super method and
then comment_write(), as leaper does, a comment will still be generated. If
a bot wants a comment even when "unhandled" it is likely deviating
enough that it should not call the super method.
This commit is contained in:
Jimmy Berry 2018-04-16 18:20:23 -05:00
parent dc30723b4a
commit f196526e73

View File

@ -343,6 +343,10 @@ class ReviewBot(object):
return self.check_source_submission(a.src_project, a.src_package, a.src_rev, a.tgt_project, a.tgt_package)
def check_action__default(self, req, a):
# Disable any comment handler to avoid making a comment even if
# comment_write() is called by another bot wrapping __default().
self.comment_handler_remove()
message = 'unhandled request type {}'.format(a.type)
self.logger.error(message)
self.review_messages['accepted'] += ': ' + message