[IMP] runbot: use reference batch to define reference builds

This commit is contained in:
Xavier-Do 2024-03-12 10:00:30 +01:00 committed by Christophe Monniez
parent 53c2afaed4
commit bbd9d8d77a
2 changed files with 7 additions and 7 deletions

View File

@ -890,9 +890,9 @@ class ConfigStep(models.Model):
for next_version in next_versions: for next_version in next_versions:
if bundle.version_id in upgrade_complement_step._get_upgrade_source_versions(next_version): if bundle.version_id in upgrade_complement_step._get_upgrade_source_versions(next_version):
target_versions |= next_version target_versions |= next_version
return target_versions.with_context(
category_id=category_id, project_id=bundle.project_id.id, base_batch = batch if batch.reference_batch_ids else batch.base_reference_batch_id
).mapped('base_bundle_id').filtered('to_upgrade').mapped('last_done_batch') return base_batch.reference_batch_ids.filtered(lambda batch: batch.bundle_id.version_id in target_versions and batch.category_id.id == category_id)
def _reference_batches_upgrade(self, batch, category_id): def _reference_batches_upgrade(self, batch, category_id):
if not batch.bundle_id.base_id.to_upgrade: if not batch.bundle_id.base_id.to_upgrade:
@ -932,9 +932,9 @@ class ConfigStep(models.Model):
from_versions(f_bundle) from_versions(f_bundle)
source_refs_bundles = source_refs_bundles.filtered('to_upgrade_from') source_refs_bundles = source_refs_bundles.filtered('to_upgrade_from')
return (target_refs_bundles | source_refs_bundles).with_context( ref_bundles = target_refs_bundles | source_refs_bundles
category_id=category_id base_batch = batch if batch.reference_batch_ids else batch.base_reference_batch_id
).mapped('last_done_batch') return base_batch.reference_batch_ids.filtered(lambda batch: batch.bundle_id in ref_bundles and batch.category_id.id == category_id)
def _log_end(self, build): def _log_end(self, build):
if self.job_type == 'create_build': if self.job_type == 'create_build':

View File

@ -54,7 +54,7 @@ class Host(models.Model):
[('host', 'in', self.mapped('name')), ('local_state', 'in', ('testing', 'running'))], [('host', 'in', self.mapped('name')), ('local_state', 'in', ('testing', 'running'))],
['host', 'local_state'], ['host', 'local_state'],
['host', 'local_state'], ['host', 'local_state'],
lazy=False lazy=False,
) )
count_by_host_state = {host.name: {} for host in self} count_by_host_state = {host.name: {} for host in self}
for group in groups: for group in groups: