[IMP] runbot: link on reference batch

This commit is contained in:
Xavier-Do 2022-02-01 08:48:16 +01:00 committed by Christophe Monniez
parent 4c8ab63af8
commit ebb342ea0c
4 changed files with 12 additions and 4 deletions

View File

@ -235,7 +235,7 @@ class Batch(models.Model):
]).sorted(lambda b: (len(b.commit_ids & merge_base_commits), b.id), reverse=True)
if batches:
batch = batches[0]
self._log('Using batch %s to define missing commits', batch.id)
self._log('Using batch [%s](%s) to define missing commits', batch.id, batch._url())
batch_exiting_commit = batch.commit_ids.filtered(lambda c: c.repo_id in merge_base_commits.repo_id)
not_matching = (batch_exiting_commit - merge_base_commits)
if not_matching:

View File

@ -27,4 +27,4 @@ class Codeowner(models.Model):
def _get_version_domain(self):
""" Helper to get the evaluated version domain """
self.ensure_one()
return ast.eval(self.version_domain) if self.version_domain else []
return ast.literal_eval(self.version_domain) if self.version_domain else []

View File

@ -95,6 +95,11 @@
<field name="name">15.0-dev-tri</field>
<field name="project_id" ref="runbot.main_project"/>
</record>
<record id="bundle_master_dev_partial_tri" model="runbot.bundle">
<field name="name">master-dev-partial-tri</field>
<field name="project_id" ref="runbot.main_project"/>
</record>
<record id="bundle_runbot_15_0" model="runbot.bundle">
<field name="name">15.0</field>

View File

@ -39,7 +39,7 @@ class Runbot(models.AbstractModel):
if bundle.is_base:
dev_remote = main_remote
self.env['runbot.branch'].create({'remote_id': dev_remote.id, 'name': bundle.name, 'is_pr': False})
if not bundle.sticky:
if not bundle.is_base:
mock_github.return_value = {
'base': {
'ref': bundle.base_id.name
@ -57,6 +57,9 @@ class Runbot(models.AbstractModel):
count += 1
branch.flush()
if 'partial' in bundle.name:
break
if not bundle.is_base:
pr = not pr
@ -90,7 +93,7 @@ class Runbot(models.AbstractModel):
def git(command):
if command[0] == 'merge-base':
_, sha1, sha2 = command
return sha1 if sha1 == sha2 else sha2 if bundle.is_base else '%s_%s' % (sha1, sha2)
return sha1 if sha1 == sha2 else sha2 #if bundle.is_base else '%s_%s' % (sha1, sha2)
elif command[0] == 'rev-list':
_, _, _, shas = command
sha1, sha2 = shas.split('...')