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>2019-11-19 15:06:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-19 15:06:00 +0300
commitb570d73ecd31e2ca9cf8c2f1adb056edf2869477 (patch)
tree0b8aa67eab6da552d8499f1fdcf9a7495dcf1379 /app/services/ci
parent34b3567c97ecc0f317adae04e10e4d7d8c8830db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/ci')
-rw-r--r--app/services/ci/create_pipeline_service.rb4
-rw-r--r--app/services/ci/process_pipeline_service.rb12
-rw-r--r--app/services/ci/retry_pipeline_service.rb4
3 files changed, 15 insertions, 5 deletions
diff --git a/app/services/ci/create_pipeline_service.rb b/app/services/ci/create_pipeline_service.rb
index 5778a48bce6..8887534bece 100644
--- a/app/services/ci/create_pipeline_service.rb
+++ b/app/services/ci/create_pipeline_service.rb
@@ -57,7 +57,9 @@ module Ci
cancel_pending_pipelines if project.auto_cancel_pending_pipelines?
pipeline_created_counter.increment(source: source)
- pipeline.process!
+ Ci::ProcessPipelineService
+ .new(pipeline)
+ .execute
end
end
diff --git a/app/services/ci/process_pipeline_service.rb b/app/services/ci/process_pipeline_service.rb
index 039670f58c8..f33cbf7ab29 100644
--- a/app/services/ci/process_pipeline_service.rb
+++ b/app/services/ci/process_pipeline_service.rb
@@ -1,14 +1,16 @@
# frozen_string_literal: true
module Ci
- class ProcessPipelineService < BaseService
+ class ProcessPipelineService
include Gitlab::Utils::StrongMemoize
attr_reader :pipeline
- def execute(pipeline, trigger_build_ids = nil)
+ def initialize(pipeline)
@pipeline = pipeline
+ end
+ def execute(trigger_build_ids = nil)
update_retried
success = process_stages_without_needs
@@ -72,7 +74,7 @@ module Ci
def process_build(build, current_status)
Gitlab::OptimisticLocking.retry_lock(build) do |subject|
- Ci::ProcessBuildService.new(project, @user)
+ Ci::ProcessBuildService.new(project, build.user)
.execute(subject, current_status)
end
end
@@ -129,5 +131,9 @@ module Ci
.update_all(retried: true) if latest_statuses.any?
end
# rubocop: enable CodeReuse/ActiveRecord
+
+ def project
+ pipeline.project
+ end
end
end
diff --git a/app/services/ci/retry_pipeline_service.rb b/app/services/ci/retry_pipeline_service.rb
index 42a13367a99..1f747aac98f 100644
--- a/app/services/ci/retry_pipeline_service.rb
+++ b/app/services/ci/retry_pipeline_service.rb
@@ -24,7 +24,9 @@ module Ci
.new(project, current_user)
.close_all(pipeline)
- pipeline.process!
+ Ci::ProcessPipelineService
+ .new(pipeline)
+ .execute
end
end
end