summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorScott Wittenburg <scott.wittenburg@kitware.com>2022-07-01 12:56:36 -0600
committerGitHub <noreply@github.com>2022-07-01 11:56:36 -0700
commit87b8321fa948b906a285406c5ea79e33258386d1 (patch)
treee6a2334c361d46123bc0e7a2cbb7c0cc07957ea9 /lib
parent8b4de69f6a1b3eab0c7304bffb867ea86b8a5413 (diff)
downloadspack-87b8321fa948b906a285406c5ea79e33258386d1.tar.gz
spack-87b8321fa948b906a285406c5ea79e33258386d1.tar.bz2
spack-87b8321fa948b906a285406c5ea79e33258386d1.tar.xz
spack-87b8321fa948b906a285406c5ea79e33258386d1.zip
gitlab: Fix pipeline generation for non-develop protected pipelines (#31378)
Release branches and tags run protected pipelines, and we noticed that those pipelines were generating all jobs in the stack, even when the mirror contained all the built specs and an up to date index. The problem was caused because the override mirror was not present in spacks mirror configuration at the time when the binary_distribution.update() method was called. This fixes that by always adding the mirror override, if present, to the list of configured mirrors.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/ci.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/spack/spack/ci.py b/lib/spack/spack/ci.py
index 254821cb3d..d600e69c42 100644
--- a/lib/spack/spack/ci.py
+++ b/lib/spack/spack/ci.py
@@ -771,9 +771,13 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
mirrors_to_check = {
'override': remote_mirror_override
}
- else:
- spack.mirror.add(
- 'ci_pr_mirror', remote_mirror_override, cfg.default_modify_scope())
+
+ # If we have a remote override and we want generate pipeline using
+ # --check-index-only, then the override mirror needs to be added to
+ # the configured mirrors when bindist.update() is run, or else we
+ # won't fetch its index and include in our local cache.
+ spack.mirror.add(
+ 'ci_pr_mirror', remote_mirror_override, cfg.default_modify_scope())
pipeline_artifacts_dir = artifacts_root
if not pipeline_artifacts_dir:
@@ -819,7 +823,7 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
user_artifacts_dir, ci_project_dir)
# Speed up staging by first fetching binary indices from all mirrors
- # (including the per-PR mirror we may have just added above).
+ # (including the override mirror we may have just added above).
try:
bindist.binary_index.update()
except bindist.FetchCacheError as e:
@@ -853,8 +857,7 @@ def generate_gitlab_ci_yaml(env, print_summary, output_file,
finally:
# Clean up remote mirror override if enabled
if remote_mirror_override:
- if spack_pipeline_type != 'spack_protected_branch':
- spack.mirror.remove('ci_pr_mirror', cfg.default_modify_scope())
+ spack.mirror.remove('ci_pr_mirror', cfg.default_modify_scope())
all_job_names = []
output_object = {}