Commit 53d31568 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'sh-fix-pipeline-cache-worker-ee' into 'master'

Fix broken master due to pipeline cache refactoring

Closes #11172

See merge request gitlab-org/gitlab-ee!11041
parents 4556218d 1268a347
......@@ -60,3 +60,5 @@ module Ci
end
end
end
Ci::ExpirePipelineCacheService.prepend(EE::Ci::ExpirePipelineCacheService)
......@@ -15,5 +15,3 @@ class ExpirePipelineCacheWorker
end
# rubocop: enable CodeReuse/ActiveRecord
end
ExpirePipelineCacheWorker.prepend(EE::ExpirePipelineCacheWorker)
# frozen_string_literal: true
module EE
module Ci
module ExpirePipelineCacheService
extend ::Gitlab::Utils::Override
override :update_etag_cache
def update_etag_cache(pipeline, store)
super
triggered_by = pipeline.triggered_by_pipeline
store.touch(project_pipeline_path(triggered_by.project, triggered_by)) if triggered_by
pipeline.triggered_pipelines.each do |triggered|
store.touch(project_pipeline_path(triggered.project, triggered))
end
end
end
end
end
# frozen_string_literal: true
module EE
module ExpirePipelineCacheWorker
extend ActiveSupport::Concern
extend ::Gitlab::Utils::Override
override :update_etag_cache
def update_etag_cache(pipeline, store)
super
triggered_by = pipeline.triggered_by_pipeline
store.touch(project_pipeline_path(triggered_by.project, triggered_by)) if triggered_by
pipeline.triggered_pipelines.each do |triggered|
store.touch(project_pipeline_path(triggered.project, triggered))
end
end
end
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
describe ExpirePipelineCacheWorker do
describe Ci::ExpirePipelineCacheService do
let(:pipeline) { create(:ci_empty_pipeline) }
subject { described_class.new }
......@@ -17,7 +17,7 @@ describe ExpirePipelineCacheWorker do
allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch)
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(dependent_pipeline_path)
subject.perform(pipeline.id)
subject.execute(pipeline)
end
end
......@@ -31,7 +31,7 @@ describe ExpirePipelineCacheWorker do
allow_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch)
expect_any_instance_of(Gitlab::EtagCaching::Store).to receive(:touch).with(dependent_pipeline_path)
subject.perform(pipeline.id)
subject.execute(pipeline)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment