Skip to content
Snippets Groups Projects
Commit a937f99a authored by Javier Jardón's avatar Javier Jardón
Browse files

Merge branch 'abderrahim/artifact-cache-junction' into 'master'

Use artifact cache specs from the parent project before those defined in junctions

Closes #618 and #401

See merge request !1113
parents 77ce0c16 24c0de16
No related branches found
No related tags found
1 merge request!1113Use artifact cache specs from the parent project before those defined in junctions
Pipeline #46761975 passed
......@@ -467,7 +467,7 @@ class ArtifactCache():
# on_failure (callable): Called if we fail to contact one of the caches.
#
def initialize_remotes(self, *, on_failure=None):
remote_specs = self.global_remote_specs
remote_specs = list(self.global_remote_specs)
for project in self.project_remote_specs:
remote_specs += self.project_remote_specs[project]
......@@ -1046,8 +1046,5 @@ class ArtifactCache():
# A list of ArtifactCacheSpec instances describing the remote artifact caches.
#
def _configured_remote_artifact_cache_specs(context, project):
project_overrides = context.get_overrides(project.name)
project_extra_specs = ArtifactCache.specs_from_config_node(project_overrides)
return list(utils._deduplicate(
project_extra_specs + project.artifact_cache_specs + context.artifact_cache_specs))
project.artifact_cache_specs + context.artifact_cache_specs))
......@@ -549,7 +549,15 @@ class Project():
#
# Load artifacts pull/push configuration for this project
self.artifact_cache_specs = ArtifactCache.specs_from_config_node(config, self.directory)
project_specs = ArtifactCache.specs_from_config_node(config, self.directory)
override_specs = ArtifactCache.specs_from_config_node(
self._context.get_overrides(self.name), self.directory)
self.artifact_cache_specs = override_specs + project_specs
if self.junction:
parent = self.junction._get_project()
self.artifact_cache_specs = parent.artifact_cache_specs + self.artifact_cache_specs
# Load remote-execution configuration for this project
project_specs = SandboxRemote.specs_from_config_node(config, self.directory)
......
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