From f196526e733ee81c49692805e19a884029ebfad3 Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Mon, 16 Apr 2018 18:20:23 -0500 Subject: [PATCH] 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. --- ReviewBot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReviewBot.py b/ReviewBot.py index 2d720b49..769f318f 100644 --- a/ReviewBot.py +++ b/ReviewBot.py @@ -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