mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] forwardport: completely update PR data when forwarding updates
The process did properly update the state, but not the squash state. It's somewhat unclear whether the state should be fully reset and require reapproval though. Maybe only the validation should be reset? The CI will eventually run and either succeed (re-validating) or fail (devalidating, hopefully) but I'm not entirely sure this is correct.
This commit is contained in:
parent
a541781ee0
commit
2aeecb68b9
@ -117,8 +117,16 @@ class UpdateQueue(models.Model, Queue):
|
||||
child.target, child.refname, s)
|
||||
|
||||
new_head = working_copy.stdout().rev_parse(child.refname).stdout.decode().strip()
|
||||
commits_count = int(working_copy.stdout().rev_list(
|
||||
f'{child.target.name}..{child.refname}',
|
||||
count=True
|
||||
).stdout.decode().strip())
|
||||
# update child's head to the head we're going to push
|
||||
child.with_context(ignore_head_update=True).head = new_head
|
||||
child.with_context(ignore_head_update=True).write({
|
||||
'head': new_head,
|
||||
# 'state': 'opened',
|
||||
'squash': commits_count == 1,
|
||||
})
|
||||
working_copy.push('-f', 'target', child.refname)
|
||||
# committing here means github could technically trigger its
|
||||
# webhook before sending a response, but committing before
|
||||
|
Loading…
Reference in New Issue
Block a user