mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[FIX] runbot: fix staging creation
This commit is contained in:
parent
a00fa04e07
commit
fd7f49aff8
@ -211,7 +211,7 @@ class Bundle(models.Model):
|
||||
elif record.project_id.tmp_prefix and record.name.startswith(record.project_id.tmp_prefix):
|
||||
record['no_build'] = True
|
||||
elif record.project_id.staging_prefix and record.name.startswith(record.project_id.staging_prefix):
|
||||
name = record.name.removeprefix(record.project_id.staging_prefix, '')
|
||||
name = record.name.removeprefix(record.project_id.staging_prefix)
|
||||
base = record.env['runbot.bundle'].search([('name', '=', name), ('project_id', '=', record.project_id.id), ('is_base', '=', True)], limit=1)
|
||||
record['build_all'] = True
|
||||
if base:
|
||||
|
@ -173,6 +173,14 @@ class TestBranchIsBase(RunbotCaseMinimalSetup):
|
||||
self.assertTrue(branch.bundle_id.is_base, "A branch matching the is_base_regex parameter should create is_base bundle")
|
||||
self.assertTrue(branch.bundle_id.sticky, "A branch matching the is_base_regex parameter should create sticky bundle")
|
||||
|
||||
staging = self.Branch.create({
|
||||
'remote_id': self.remote_server.id,
|
||||
'name': 'staging.saas-13.4',
|
||||
'is_pr': False,
|
||||
})
|
||||
self.assertEqual(staging.bundle_id.base_id, branch.bundle_id, 'The staging branch should have the correct nase bundle')
|
||||
|
||||
|
||||
def test_host(self):
|
||||
r10 = self.env['runbot.host'].create({'name': 'runbot10.odoo.com'})
|
||||
r12 = self.env['runbot.host'].create({'name': 'runbot12.odoo.com', 'assigned_only': True})
|
||||
|
Loading…
Reference in New Issue
Block a user