Skip to content

Commit 0f2b55a

Browse files
Xavier-Dod-fence
authored andcommitted
[IMP] runbot: make params version_id optionnal
1 parent d49a4ab commit 0f2b55a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

runbot/models/batch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def _fill_missing(branch_commits, match_type):
384384
self._warning(f'This batch will use base commits instead of bundle commits for trigger {trigger.name}')
385385
trigger_commit_link_by_repos = base_commit_link_by_repos
386386
commits_links = [trigger_commit_link_by_repos[repo.id].id for repo in trigger_repos]
387-
version_id = bundle_version_id if trigger.version_dependent else False
387+
version_id = bundle_version_id if (trigger.version_dependent or trigger.batch_dependent) else False
388388
params_value = {
389389
'version_id': version_id,
390390
'extra_params': extra_params,

runbot/models/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class BuildParameters(models.Model):
7070
# execution parametter
7171
commit_link_ids = fields.Many2many('runbot.commit.link', copy=True)
7272
commit_ids = fields.Many2many('runbot.commit', compute='_compute_commit_ids')
73-
version_id = fields.Many2one('runbot.version', required=True, index=True)
73+
version_id = fields.Many2one('runbot.version', index=True)
7474
project_id = fields.Many2one('runbot.project', required=True, index=True) # for access rights
7575
trigger_id = fields.Many2one('runbot.trigger', index=True) # for access rights
7676
create_batch_id = fields.Many2one('runbot.batch', index=True)
@@ -534,7 +534,7 @@ def _result_multi(self):
534534
def _compute_dest(self):
535535
for build in self:
536536
if build.id:
537-
nickname = build.params_id.version_id.name
537+
nickname = build.params_id.version_id.name or 'build'
538538
nickname = re.sub(r'"|\'|~|\:', '', nickname)
539539
nickname = re.sub(r'_|/|\.', '-', nickname)
540540
build.dest = ("%05d-%s" % (build.id or 0, nickname[:32])).lower()

0 commit comments

Comments
 (0)