mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[CHG] runbot_merge: ignore long comments
Comments which are too long cause `logging` itself to crash, which kinda sucks. And long comments seem very unlikely to have anything for the mergebot to do besides. So just ignore them at intake. Limit is set to 5000 because there needs to be a limit somewhere and that's about the extent of it.
This commit is contained in:
parent
286c1fdaee
commit
6ada35a200
@ -386,6 +386,10 @@ def handle_comment(env, event):
|
||||
issue = event['issue']['number']
|
||||
author = event['comment']['user']['login']
|
||||
comment = event['comment']['body']
|
||||
if len(comment) > 5000:
|
||||
_logger.warning('comment(%s): %s %s#%s => ignored (%d characters)', event['comment']['html_url'], author, repo, issue, len(comment))
|
||||
return "ignored: too big"
|
||||
|
||||
_logger.info('comment[%s]: %s %s#%s %r', event['action'], author, repo, issue, comment)
|
||||
if event['action'] != 'created':
|
||||
return "Ignored: action (%r) is not 'created'" % event['action']
|
||||
@ -397,6 +401,9 @@ def handle_review(env, event):
|
||||
pr = event['pull_request']['number']
|
||||
author = event['review']['user']['login']
|
||||
comment = event['review']['body'] or ''
|
||||
if len(comment) > 5000:
|
||||
_logger.warning('comment(%s): %s %s#%s => ignored (%d characters)', event['review']['html_url'], author, repo, pr, len(comment))
|
||||
return "ignored: too big"
|
||||
|
||||
_logger.info('review[%s]: %s %s#%s %r', event['action'], author, repo, pr, comment)
|
||||
if event['action'] != 'submitted':
|
||||
|
Loading…
Reference in New Issue
Block a user