mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: don't kill build if build may be used.
The current stratey to check if a build can be killed is to ensure that no slot unskipped slots points to the same build. Since the check is only done after a prepare, it should ensure that the new slot have the build linked before checking if the previous batch can kill it's build. Since the slot are now filled latter on (after the minimal check) it is possible that a build is considered killable an killed before being linked again. To fix this, we just need to consier params instead of builds to define if a build is killable or not. If the params of a builds are linked elsewere, don't kill them.
This commit is contained in:
parent
e241f03321
commit
0eae784a1e
@ -92,7 +92,7 @@ class Batch(models.Model):
|
||||
build = slot.build_id
|
||||
if build.global_state in ('running', 'done'):
|
||||
continue
|
||||
testing_slots = build.slot_ids.filtered(lambda s: not s.skipped)
|
||||
testing_slots = build.params_id.slot_ids.filtered(lambda s: not s.skipped)
|
||||
if not testing_slots:
|
||||
if build.global_state == 'pending':
|
||||
build._skip('Newer build found')
|
||||
|
@ -76,6 +76,8 @@ class BuildParameters(models.Model):
|
||||
|
||||
fingerprint = fields.Char('Fingerprint', compute='_compute_fingerprint', store=True, index=True)
|
||||
|
||||
slot_ids = fields.One2many('runbot.batch.slot', 'params_id')
|
||||
|
||||
_sql_constraints = [
|
||||
('unique_fingerprint', 'unique (fingerprint)', 'avoid duplicate params'),
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user