diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-27 08:46:57 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2023-01-27 08:46:57 +0000 |
commit | 9c263affb5edb37ecc0701027855fab289bce237 (patch) | |
tree | 0f98fec2c793f4ecdf859cebfb7734982bc50989 /.gitlab | |
parent | 6d788b1170d1164c4f4e13e1d1866c6f8d0630ed (diff) | |
download | haskell-9c263affb5edb37ecc0701027855fab289bce237.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.
Diffstat (limited to '.gitlab')
-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 |