mirror of
https://github.com/odoo/runbot.git
synced 2025-03-16 07:55:45 +07:00
[FIX] runbot: take parent into account when searching last branch build
If a branch triggers an hidden build on a another one (sticky ususally), the last build of the branch will be considered to be this one and trigger a new build. The same problem can occur when cloning a subbuild to slighlty change a parameter instead of making an exact rebuild since the build type may still be normal in this case. This commit will simply ignore subbuild in this case.
This commit is contained in:
parent
d9ff43fa6b
commit
ef7029668a
@ -328,7 +328,7 @@ class runbot_repo(models.Model):
|
||||
|
||||
self.env.cr.execute("""
|
||||
SELECT DISTINCT ON (branch_id) name, branch_id
|
||||
FROM runbot_build WHERE branch_id in %s AND build_type = 'normal' ORDER BY branch_id,id DESC;
|
||||
FROM runbot_build WHERE branch_id in %s AND build_type = 'normal' AND parent_id is null ORDER BY branch_id,id DESC;
|
||||
""", (tuple([ref_branches[r[0]] for r in refs]),))
|
||||
# generate a set of tuples (branch_id, sha)
|
||||
builds_candidates = {(r[1], r[0]) for r in self.env.cr.fetchall()}
|
||||
|
Loading…
Reference in New Issue
Block a user