Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only check for products to be built successfully #3026

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions gocd/bci_repo_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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

Expand Down
Loading