[IMP] runbot_merge: logging of comment commands (or lack thereof)

This commit is contained in:
Xavier Morel 2018-06-07 17:30:06 +02:00 committed by xmo-odoo
parent 381c504584
commit 0725c77323
2 changed files with 15 additions and 1 deletions

View File

@ -100,7 +100,7 @@ def handle_pr(event):
'github_login': author_name,
})
_logger.info("%s: %s:%s (%s)", event['action'], repo.name, pr['number'], author.github_login)
_logger.info("%s: %s:%s (%s) (%s)", event['action'], repo.name, pr['number'], pr['title'].strip(), author.github_login)
if event['action'] == 'opened':
# some PRs have leading/trailing newlines in body/title (resp)
title = pr['title'].strip()
@ -188,6 +188,14 @@ def handle_comment(event):
if 'pull_request' not in event['issue']:
return "issue comment, ignoring"
_logger.info(
'comment: %s %s:%s "%s"',
event['sender']['login'],
event['repository']['full_name'],
event['issue']['number'],
event['comment']['body'],
)
env = request.env(user=1)
partner = env['res.partner'].search([('github_login', '=', event['sender']['login']),])
pr = env['runbot_merge.pull_requests'].search([

View File

@ -455,6 +455,12 @@ class PullRequests(models.Model):
if ps is not None
)
if not commands:
_logger.info("found no commands in comment of %s (%s) (%s%s)", author.github_login, author.display_name,
comment[:50], '...' if len(comment) > 50 else ''
)
return 'ok'
applied, ignored = [], []
for command, param in commands.items():
ok = False