Skip to content
Snippets Groups Projects
Commit 9c263aff authored by Matthew Pickering's avatar Matthew Pickering
Browse files

rel_eng: Add check to make sure that release jobs are downloaded by fetch-gitlab

This check makes sure that if a job is a prefixed by "release-" then the
script downloads it and understands how to map the job name to the
platform.
parent 6d788b11
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,8 @@ def strip_prefix(s, prefix):
else:
return None
do_not_distribute = set(["release-x86_64-linux-fedora33-release-hackage"])
def job_triple(job_name):
bindists = {
'release-x86_64-windows-release': 'x86_64-unknown-mingw32',
......@@ -54,6 +56,12 @@ def job_triple(job_name):
#return strip_prefix(job.name, 'validate-')
return None
class UnhandledJobException(Exception):
# Raised when there is a release job in the pipeline but we don't explicitly handle it.
def __init__(self, name):
self.message = f"{name} is a release job but not downloaded"
super().__init__(self.message)
def fetch_artifacts(release: str, pipeline_id: int,
dest_dir: Path, gl: gitlab.Gitlab):
dest_dir.mkdir(exist_ok=True)
......@@ -72,6 +80,8 @@ def fetch_artifacts(release: str, pipeline_id: int,
job = proj.jobs.get(pipeline_job.id)
triple = job_triple(job.name)
if triple is None:
if job.name.startswith("release") and not (job.name in do_not_distribute):
raise(UnhandledJobException(job.name))
logging.info(f'ignoring {job.name}')
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment