5
0
mirror of https://github.com/odoo/runbot.git synced 2025-03-16 16:05:42 +07:00

[FIX] runbot_merge: order of staging branch updates

When creating staging branches from tmp, use the iteration order of
the repos in the project (that way it's easy to see and eventually
configure if we add sequences or whatever, in the short term it's the
order in which the repos were added which is the one we want).

This ensures we stage odoo/odoo before we stage odoo/enterprise
without relying on dict order of iteration, or needing meta to be an
OrderedDict.

The issue is if stagings are created/updated the other way around, the
runbot may pick up staging on odoo/enterprise before odoo/odoo has
been updated, and thus build odoo/enterprise with the wrong odoo/odoo
commit, and defeat the entire point of it.

Example: http://runbot.odoo.com/runbot/build/376112 was triggered by
the same staging as http://runbot.odoo.com/runbot/build/376113, but
used the previous staging head.

The creation order of tmp branches should not matter so ignore it.
This commit is contained in:
Xavier Morel 2018-09-20 15:50:53 +02:00
parent 3885ca244c
commit fa94b269de

View File

@ -202,7 +202,8 @@ class Project(models.Model):
'heads': json.dumps(heads)
})
# create staging branch from tmp
for r, it in meta.items():
for r in project.repo_ids:
it = meta[r]
it['gh'].set_ref('staging.{}'.format(branch.name), heads[r.name])
# creating the staging doesn't trigger a write on the prs