Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
181627f9
Commit
181627f9
authored
Jan 31, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the diff with EE in Ci::CreatePipelineService
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
c48f29c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
3 deletions
+72
-3
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+11
-3
lib/gitlab/ci/pipeline/chain/limit/activity.rb
lib/gitlab/ci/pipeline/chain/limit/activity.rb
+21
-0
lib/gitlab/ci/pipeline/chain/limit/size.rb
lib/gitlab/ci/pipeline/chain/limit/size.rb
+21
-0
lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb
lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb
+19
-0
No files found.
app/services/ci/create_pipeline_service.rb
View file @
181627f9
...
...
@@ -7,14 +7,17 @@ module Ci
CreateError
=
Class
.
new
(
StandardError
)
SEQUENCE
=
[
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Build
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
RemoveUnwantedChatJobs
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Validate
::
Abilities
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Validate
::
Repository
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Validate
::
Config
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Skip
,
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Limit
::
Size
,
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
command
=
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Command
.
new
(
...
...
@@ -32,7 +35,8 @@ module Ci
variables_attributes:
params
[
:variables_attributes
],
project:
project
,
current_user:
current_user
,
push_options:
params
[
:push_options
])
push_options:
params
[
:push_options
],
**
extra_options
(
**
options
))
sequence
=
Gitlab
::
Ci
::
Pipeline
::
Chain
::
Sequence
.
new
(
pipeline
,
command
,
SEQUENCE
)
...
...
@@ -103,5 +107,9 @@ module Ci
pipeline
.
project
.
source_of_merge_requests
.
opened
.
where
(
source_branch:
pipeline
.
ref
)
end
# rubocop: enable CodeReuse/ActiveRecord
def
extra_options
{}
# overriden in EE
end
end
end
lib/gitlab/ci/pipeline/chain/limit/activity.rb
0 → 100644
View file @
181627f9
# 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
lib/gitlab/ci/pipeline/chain/limit/size.rb
0 → 100644
View file @
181627f9
# 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
lib/gitlab/ci/pipeline/chain/remove_unwanted_chat_jobs.rb
0 → 100644
View file @
181627f9
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment