Commit 181627f9 authored by Rémy Coutable's avatar Rémy Coutable

Reduce the diff with EE in Ci::CreatePipelineService

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent c48f29c1
...@@ -7,14 +7,17 @@ module Ci ...@@ -7,14 +7,17 @@ module Ci
CreateError = Class.new(StandardError) CreateError = Class.new(StandardError)
SEQUENCE = [Gitlab::Ci::Pipeline::Chain::Build, SEQUENCE = [Gitlab::Ci::Pipeline::Chain::Build,
Gitlab::Ci::Pipeline::Chain::RemoveUnwantedChatJobs,
Gitlab::Ci::Pipeline::Chain::Validate::Abilities, Gitlab::Ci::Pipeline::Chain::Validate::Abilities,
Gitlab::Ci::Pipeline::Chain::Validate::Repository, Gitlab::Ci::Pipeline::Chain::Validate::Repository,
Gitlab::Ci::Pipeline::Chain::Validate::Config, Gitlab::Ci::Pipeline::Chain::Validate::Config,
Gitlab::Ci::Pipeline::Chain::Skip, Gitlab::Ci::Pipeline::Chain::Skip,
Gitlab::Ci::Pipeline::Chain::Limit::Size,
Gitlab::Ci::Pipeline::Chain::Populate, Gitlab::Ci::Pipeline::Chain::Populate,
Gitlab::Ci::Pipeline::Chain::Create].freeze Gitlab::Ci::Pipeline::Chain::Create,
Gitlab::Ci::Pipeline::Chain::Limit::Activity].freeze
def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, merge_request: nil, &block) def execute(source, ignore_skip_ci: false, save_on_errors: true, trigger_request: nil, schedule: nil, merge_request: nil, **options, &block)
@pipeline = Ci::Pipeline.new @pipeline = Ci::Pipeline.new
command = Gitlab::Ci::Pipeline::Chain::Command.new( command = Gitlab::Ci::Pipeline::Chain::Command.new(
...@@ -32,7 +35,8 @@ module Ci ...@@ -32,7 +35,8 @@ module Ci
variables_attributes: params[:variables_attributes], variables_attributes: params[:variables_attributes],
project: project, project: project,
current_user: current_user, current_user: current_user,
push_options: params[:push_options]) push_options: params[:push_options],
**extra_options(**options))
sequence = Gitlab::Ci::Pipeline::Chain::Sequence sequence = Gitlab::Ci::Pipeline::Chain::Sequence
.new(pipeline, command, SEQUENCE) .new(pipeline, command, SEQUENCE)
...@@ -103,5 +107,9 @@ module Ci ...@@ -103,5 +107,9 @@ module Ci
pipeline.project.source_of_merge_requests.opened.where(source_branch: pipeline.ref) pipeline.project.source_of_merge_requests.opened.where(source_branch: pipeline.ref)
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
def extra_options
{} # overriden in EE
end
end end
end end
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
module Limit
class Activity < Chain::Base
def perform!
# to be overriden in EE
end
def break?
false # to be overriden in EE
end
end
end
end
end
end
end
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
module Limit
class Size < Chain::Base
def perform!
# to be overriden in EE
end
def break?
false # to be overriden in EE
end
end
end
end
end
end
end
# frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
class RemoveUnwantedChatJobs < Chain::Base
def perform!
# to be overriden in EE
end
def break?
false
end
end
end
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