[IMP] runbot_merge: optimise edited event

For the longest time Github's `change` key was borked when
transitioning a description to and from empty. They fixed that during
2023, which I already saw and impacted on
DC (xmo-odoo/dummy_central@1ebed9d418
and xmo-odoo/dummy_central@937e87c2a4)
but this had yet to be taken in account by the mergebot.

This is now done, the code is functionally reverted to what it was
before I realised `changes` was hosed and moved off of it in
3da1874196.

Fixes #743
This commit is contained in:
Xavier Morel 2024-10-22 13:12:28 +02:00
parent cf4d162907
commit 2174d7da31

View File

@ -210,12 +210,8 @@ def handle_pr(env, event):
updates['target'] = branch.id updates['target'] = branch.id
updates['squash'] = pr['commits'] == 1 updates['squash'] = pr['commits'] == 1
# turns out github doesn't bother sending a change key if the body is if 'title' in event['changes'] or 'body' in event['changes']:
# changing from empty (None), therefore ignore that entirely, just updates['message'] = utils.make_message(pr)
# generate the message and check if it changed
message = utils.make_message(pr)
if message != pr_obj.message:
updates['message'] = message
_logger.info("update: %s = %s (by %s)", pr_obj.display_name, updates, event['sender']['login']) _logger.info("update: %s = %s (by %s)", pr_obj.display_name, updates, event['sender']['login'])
if updates: if updates: