diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-27 08:46:57 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-30 21:21:11 -0500 |
commit | f26d27ec3a2e6bc97ae92b6942d7d9299470418d (patch) | |
tree | ae8385684fb7ecf34885b1cb09f0dbaeb4c512a7 | |
parent | de963cb62a39ade6615d705d5c9c89b6629868f5 (diff) | |
download | haskell-f26d27ec3a2e6bc97ae92b6942d7d9299470418d.tar.gz |
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.
-rw-r--r-- | .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/.gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py b/.gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py index d51c298a9f..166ed14f5c 100644 --- a/.gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py +++ b/.gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py @@ -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 |