From 2a7a3c61675572db9ecdaf3b4e5e390f1a0c7538 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 11 Sep 2018 13:53:41 +0200 Subject: [PATCH] [FIX] runbot_merge: don't close PRs pointing to dummy commit e98a8caffbe1cc22777940bcf667db92c5738b81 added dummy commits to the heads of stagings and fixed most places to make a difference between the staging head (including dummy commit) and the actual merge head, but the difference was missed in the comment closing a PR, which was still using the staging head and thus pointing to the dummy commit e.g. (https://github.com/odoo/odoo/pull/26821#issuecomment-420244592) --- runbot_merge/models/pull_requests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runbot_merge/models/pull_requests.py b/runbot_merge/models/pull_requests.py index d2990d1b..760ba38c 100644 --- a/runbot_merge/models/pull_requests.py +++ b/runbot_merge/models/pull_requests.py @@ -107,7 +107,8 @@ class Project(models.Model): prs.write({'state': 'merged'}) for pr in prs: # FIXME: this is the staging head rather than the actual merge commit for the PR - gh[pr.repository.name].close(pr.number, 'Merged in {}'.format(staging_heads[pr.repository.name])) + staging_head = staging_heads.get(pr.repository.name + '^') or staging_heads[pr.repository.name] + gh[pr.repository.name].close(pr.number, 'Merged in {}'.format(staging_head)) finally: staging.batch_ids.write({'active': False}) staging.write({'active': False})