From ad0217e8e4a4a40d9088a330a6faa396cccde602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Thu, 26 Oct 2023 15:37:00 +0200 Subject: [PATCH] Only check for products to be built successfully The "images" repository contains both containers and ftp products. we only want to wait for the products, which are built in the "local" arch. --- gocd/bci_repo_publish.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gocd/bci_repo_publish.py b/gocd/bci_repo_publish.py index 4525cfe2a..77f874b06 100755 --- a/gocd/bci_repo_publish.py +++ b/gocd/bci_repo_publish.py @@ -58,11 +58,13 @@ def openqa_jobs_for_product(self, arch, version, build): } return self.openqa.openqa_request('GET', 'jobs', values)['jobs'] - def is_repo_published(self, project, repo): + def is_repo_published(self, project, repo, arch=None): """Validates that the given prj/repo is fully published and all builds have succeeded.""" - url = makeurl(self.apiurl, ['build', project, '_result'], - {'view': 'summary', 'repository': repo}) + result_filter = {'view': 'summary', 'repository': repo} + if arch: + result_filter['arch'] = arch + url = makeurl(self.apiurl, ['build', project, '_result'], result_filter) root = ET.parse(http_GET(url)).getroot() for result in root.findall('result'): if result.get('dirty', 'false') != 'false': @@ -79,7 +81,7 @@ def is_repo_published(self, project, repo): def run(self, version, token=None): build_prj = f'SUSE:SLE-{version}:Update:BCI' - if not self.is_repo_published(build_prj, 'images'): + if not self.is_repo_published(build_prj, 'images', 'local'): self.logger.info(f'{build_prj}/images not successfully built') return