Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] less volatile reference databases phase2 #869

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions runbot/models/build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ def _run_configure_upgrade(self, build):
dbs = dump_builds.database_ids.sorted('db_suffix')
valid_databases += list(self._filter_upgrade_database(dbs, upgrade_db.db_pattern))
if not valid_databases:
build._log('_run_configure_upgrade', 'No datase found for pattern %s' % (upgrade_db.db_pattern), level='ERROR')
build._log('_run_configure_upgrade', 'No database found for pattern %s' % (upgrade_db.db_pattern), level='ERROR')
for db in valid_databases:
#commit_ids = build.params_id.commit_ids
#if commit_ids != target.params_id.commit_ids:
Expand All @@ -656,7 +656,7 @@ def _run_configure_upgrade(self, build):
'upgrade_to_build_id': target.id,
'upgrade_from_build_id': source,
'dump_db': db.id,
'config_id': self.upgrade_config_id
'config_id': self.upgrade_config_id,
})

child.description = 'Testing migration from %s to %s using db %s (%s)' % (
Expand Down Expand Up @@ -822,9 +822,9 @@ def _reference_batches_complement(self, batch, trigger):
for next_version in next_versions:
if bundle.version_id in upgrade_complement_step._get_upgrade_source_versions(next_version):
target_versions |= next_version
return target_versions.with_context(
category_id=category_id, project_id=bundle.project_id.id,
).mapped('base_bundle_id').filtered('to_upgrade').mapped('last_done_batch')

base_batch = batch if batch.reference_batch_ids else batch.base_reference_batch_id
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):
bundle = batch.bundle_id
Expand Down Expand Up @@ -862,9 +862,9 @@ def from_versions(f_bundle):
from_versions(f_bundle)
source_refs_bundles = source_refs_bundles.filtered('to_upgrade')

return (target_refs_bundles | source_refs_bundles).with_context(
category_id=category_id
).mapped('last_done_batch')
ref_bundles = target_refs_bundles | source_refs_bundles
base_batch = batch if batch.reference_batch_ids else batch.base_reference_batch_id
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):
if self.job_type == 'create_build':
Expand Down
2 changes: 1 addition & 1 deletion runbot/models/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _compute_nb(self):
[('host', 'in', self.mapped('name')), ('local_state', 'in', ('testing', 'running'))],
['host', 'local_state'],
['host', 'local_state'],
lazy=False
lazy=False,
)
count_by_host_state = {host.name: {} for host in self}
for group in groups:
Expand Down
3 changes: 2 additions & 1 deletion runbot/tests/test_dockerfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

from unittest.mock import patch, mock_open

from odoo.tests.common import Form, tagged, HttpCase
from odoo.tests import Form
from odoo.tests.common import tagged, HttpCase
from .common import RunbotCase

_logger = logging.getLogger(__name__)
Expand Down
Loading