mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: deterministic order
This commit is contained in:
parent
2a18cd7f3d
commit
1644253c94
@ -6,7 +6,7 @@
|
|||||||
'author': "Odoo SA",
|
'author': "Odoo SA",
|
||||||
'website': "http://runbot.odoo.com",
|
'website': "http://runbot.odoo.com",
|
||||||
'category': 'Website',
|
'category': 'Website',
|
||||||
'version': '5.6',
|
'version': '5.7',
|
||||||
'application': True,
|
'application': True,
|
||||||
'depends': ['base', 'base_automation', 'website'],
|
'depends': ['base', 'base_automation', 'website'],
|
||||||
'data': [
|
'data': [
|
||||||
|
15
runbot/migrations/17.0.5.7/pre-migration.py
Normal file
15
runbot/migrations/17.0.5.7/pre-migration.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
|
def migrate(cr, version):
|
||||||
|
cr.execute('ALTER TABLE runbot_commit_link ADD COLUMN repo_id INT')
|
||||||
|
cr.execute('ALTER TABLE runbot_commit_link ADD COLUMN sequence INT')
|
||||||
|
cr.execute('''
|
||||||
|
UPDATE runbot_commit_link
|
||||||
|
SET repo_id=commit.repo_id, sequence = repo.sequence
|
||||||
|
FROM runbot_commit commit
|
||||||
|
JOIN runbot_repo repo ON commit.repo_id=repo.id
|
||||||
|
WHERE commit.id = runbot_commit_link.commit_id
|
||||||
|
''')
|
@ -195,12 +195,16 @@ class Commit(models.Model):
|
|||||||
class CommitLink(models.Model):
|
class CommitLink(models.Model):
|
||||||
_name = 'runbot.commit.link'
|
_name = 'runbot.commit.link'
|
||||||
_description = "Build commit"
|
_description = "Build commit"
|
||||||
|
_order = 'sequence,repo_id,id'
|
||||||
|
|
||||||
commit_id = fields.Many2one('runbot.commit', 'Commit', required=True, index=True)
|
commit_id = fields.Many2one('runbot.commit', 'Commit', required=True, index=True)
|
||||||
# Link info
|
# Link info
|
||||||
match_type = fields.Selection([('new', 'New head of branch'), ('head', 'Head of branch'), ('base_head', 'Found on base branch'), ('base_match', 'Found on base branch')]) # HEAD, DEFAULT
|
match_type = fields.Selection([('new', 'New head of branch'), ('head', 'Head of branch'), ('base_head', 'Found on base branch'), ('base_match', 'Found on base branch')]) # HEAD, DEFAULT
|
||||||
branch_id = fields.Many2one('runbot.branch', string='Found in branch') # Shouldn't be use for anything else than display
|
branch_id = fields.Many2one('runbot.branch', string='Found in branch') # Shouldn't be use for anything else than display
|
||||||
|
|
||||||
|
repo_id = fields.Many2one('runbot.repo', related='commit_id.repo_id', store=True)
|
||||||
|
sequence = fields.Integer('runbot.repo', related='commit_id.repo_id.sequence', store=True)
|
||||||
|
|
||||||
base_commit_id = fields.Many2one('runbot.commit', 'Base head commit', index=True)
|
base_commit_id = fields.Many2one('runbot.commit', 'Base head commit', index=True)
|
||||||
merge_base_commit_id = fields.Many2one('runbot.commit', 'Merge Base commit', index=True)
|
merge_base_commit_id = fields.Many2one('runbot.commit', 'Merge Base commit', index=True)
|
||||||
base_behind = fields.Integer('# commits behind base')
|
base_behind = fields.Integer('# commits behind base')
|
||||||
|
@ -461,8 +461,8 @@ class TestUpgradeFlow(RunbotCase):
|
|||||||
self.assertTrue(ro_volumes.pop(f'/home/{user}/.odoorc').startswith(self.env['runbot.runbot']._path('build')))
|
self.assertTrue(ro_volumes.pop(f'/home/{user}/.odoorc').startswith(self.env['runbot.runbot']._path('build')))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
list(ro_volumes.keys()), [
|
list(ro_volumes.keys()), [
|
||||||
'/data/build/addons',
|
|
||||||
'/data/build/server',
|
'/data/build/server',
|
||||||
|
'/data/build/addons',
|
||||||
'/data/build/upgrade',
|
'/data/build/upgrade',
|
||||||
],
|
],
|
||||||
"other commit should have been added automaticaly"
|
"other commit should have been added automaticaly"
|
||||||
@ -470,7 +470,7 @@ class TestUpgradeFlow(RunbotCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
str(cmd),
|
str(cmd),
|
||||||
'python3 server/server.py {addons_path} --no-xmlrpcs --no-netrpc -u all -d {db_name} --stop-after-init --max-cron-threads=0'.format(
|
'python3 server/server.py {addons_path} --no-xmlrpcs --no-netrpc -u all -d {db_name} --stop-after-init --max-cron-threads=0'.format(
|
||||||
addons_path='--addons-path addons,server/addons,server/core/addons',
|
addons_path='--addons-path server/addons,server/core/addons,addons',
|
||||||
db_name=f'{current_build.dest}-{suffix}')
|
db_name=f'{current_build.dest}-{suffix}')
|
||||||
)
|
)
|
||||||
self.patchers['docker_run'].side_effect = docker_run_upgrade
|
self.patchers['docker_run'].side_effect = docker_run_upgrade
|
||||||
|
Loading…
Reference in New Issue
Block a user