From 5d814468d9f0fc0e892100471f0b5cc7f031f2e3 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Wed, 21 Feb 2018 14:01:02 +0100 Subject: Change cache index delimiter to character not recognizable as variable part --- app/models/ci/build.rb | 2 +- spec/models/ci/build_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index ee987949080..b230b7f47ef 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -467,7 +467,7 @@ module Ci if cache && project.jobs_cache_index cache = cache.merge( - key: "#{cache[:key]}_#{project.jobs_cache_index}") + key: "#{cache[:key]}-#{project.jobs_cache_index}") end [cache] diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 2b6b6a61182..c27313ed88b 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -277,7 +277,7 @@ describe Ci::Build do allow_any_instance_of(Project).to receive(:jobs_cache_index).and_return(1) end - it { is_expected.to be_an(Array).and all(include(key: "key_1")) } + it { is_expected.to be_an(Array).and all(include(key: "key-1")) } end context 'when project does not have jobs_cache_index' do -- cgit v1.2.1 From a0f020cd0d781cf8e361c217759e159ee01777ab Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Wed, 21 Feb 2018 14:04:32 +0100 Subject: Add CHANGELOG entry --- changelogs/unreleased/43373-fix-cache-index-appending.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changelogs/unreleased/43373-fix-cache-index-appending.yml diff --git a/changelogs/unreleased/43373-fix-cache-index-appending.yml b/changelogs/unreleased/43373-fix-cache-index-appending.yml new file mode 100644 index 00000000000..fdb293ea04d --- /dev/null +++ b/changelogs/unreleased/43373-fix-cache-index-appending.yml @@ -0,0 +1,5 @@ +--- +title: Fix issue with cache key being empty when variable used as the key +merge_request: 17260 +author: +type: fixed -- cgit v1.2.1