Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 04:45:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-09-19 04:45:44 +0300
commit85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch)
tree9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/workers/ci
parent15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff)
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/workers/ci')
-rw-r--r--app/workers/ci/build_trace_chunk_flush_worker.rb10
-rw-r--r--app/workers/ci/create_cross_project_pipeline_worker.rb2
-rw-r--r--app/workers/ci/pipelines/create_artifact_worker.rb18
-rw-r--r--app/workers/ci/ref_delete_unlock_artifacts_worker.rb2
4 files changed, 26 insertions, 6 deletions
diff --git a/app/workers/ci/build_trace_chunk_flush_worker.rb b/app/workers/ci/build_trace_chunk_flush_worker.rb
index fe59ba896a4..2908c7c2d0b 100644
--- a/app/workers/ci/build_trace_chunk_flush_worker.rb
+++ b/app/workers/ci/build_trace_chunk_flush_worker.rb
@@ -1,14 +1,16 @@
# frozen_string_literal: true
module Ci
- class BuildTraceChunkFlushWorker # rubocop:disable Scalability/IdempotentWorker
+ class BuildTraceChunkFlushWorker
include ApplicationWorker
include PipelineBackgroundQueue
+ idempotent!
+
# rubocop: disable CodeReuse/ActiveRecord
- def perform(build_trace_chunk_id)
- ::Ci::BuildTraceChunk.find_by(id: build_trace_chunk_id).try do |build_trace_chunk|
- build_trace_chunk.persist_data!
+ def perform(chunk_id)
+ ::Ci::BuildTraceChunk.find_by(id: chunk_id).try do |chunk|
+ chunk.persist_data!
end
end
# rubocop: enable CodeReuse/ActiveRecord
diff --git a/app/workers/ci/create_cross_project_pipeline_worker.rb b/app/workers/ci/create_cross_project_pipeline_worker.rb
index 713d0092b32..679574d9f60 100644
--- a/app/workers/ci/create_cross_project_pipeline_worker.rb
+++ b/app/workers/ci/create_cross_project_pipeline_worker.rb
@@ -9,7 +9,7 @@ module Ci
def perform(bridge_id)
::Ci::Bridge.find_by_id(bridge_id).try do |bridge|
- ::Ci::CreateCrossProjectPipelineService
+ ::Ci::CreateDownstreamPipelineService
.new(bridge.project, bridge.user)
.execute(bridge)
end
diff --git a/app/workers/ci/pipelines/create_artifact_worker.rb b/app/workers/ci/pipelines/create_artifact_worker.rb
new file mode 100644
index 00000000000..220df975503
--- /dev/null
+++ b/app/workers/ci/pipelines/create_artifact_worker.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module Ci
+ module Pipelines
+ class CreateArtifactWorker
+ include ApplicationWorker
+ include PipelineBackgroundQueue
+
+ idempotent!
+
+ def perform(pipeline_id)
+ Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
+ Ci::Pipelines::CreateArtifactService.new.execute(pipeline)
+ end
+ end
+ end
+ end
+end
diff --git a/app/workers/ci/ref_delete_unlock_artifacts_worker.rb b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb
index 3b4a6fcf630..aaa77efbb74 100644
--- a/app/workers/ci/ref_delete_unlock_artifacts_worker.rb
+++ b/app/workers/ci/ref_delete_unlock_artifacts_worker.rb
@@ -10,7 +10,7 @@ module Ci
def perform(project_id, user_id, ref_path)
::Project.find_by_id(project_id).try do |project|
::User.find_by_id(user_id).try do |user|
- ::Ci::Ref.find_by_ref_path(ref_path).try do |ci_ref|
+ project.ci_refs.find_by_ref_path(ref_path).try do |ci_ref|
::Ci::UnlockArtifactsService
.new(project, user)
.execute(ci_ref)