mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[IMP] runbot_merge: trigger staging if re-enabled for branch
If staging gets re-enabled on a branch (or the branch itself gets re-enabled), immediately run a staging cron as there may already be PRs waiting, and no trigger enqueued: cron triggers have no payload, they just get removed when the cron runs which means if a bunch of PRs become ready for branch B with staging disabled, the cron is going to run, it's going to stage nothing on that branch (because staging is disabled) then it's going to delete all the triggers. Fixes #979
This commit is contained in:
parent
5441ba12ae
commit
c974f51036
@ -315,6 +315,13 @@ class Branch(models.Model):
|
|||||||
'message': tmpl._format(pr=pr),
|
'message': tmpl._format(pr=pr),
|
||||||
} for pr in actives.prs])
|
} for pr in actives.prs])
|
||||||
self.env.ref('runbot_merge.branch_cleanup')._trigger()
|
self.env.ref('runbot_merge.branch_cleanup')._trigger()
|
||||||
|
|
||||||
|
if (
|
||||||
|
(vals.get('staging_enabled') is True and not all(self.mapped('staging_enabled')))
|
||||||
|
or (vals.get('active') is True and not all(self.mapped('active')))
|
||||||
|
):
|
||||||
|
self.env.ref('runbot_merge.staging_cron')._trigger()
|
||||||
|
|
||||||
super().write(vals)
|
super().write(vals)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user