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
03ff8139
Commit
03ff8139
authored
Aug 07, 2019
by
Sean Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel rendundant pipelines
parent
e74c7bad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
ee/app/services/merge_trains/refresh_merge_request_service.rb
...pp/services/merge_trains/refresh_merge_request_service.rb
+11
-1
No files found.
ee/app/services/merge_trains/refresh_merge_request_service.rb
View file @
03ff8139
...
...
@@ -15,7 +15,11 @@ module MergeTrains
validate!
pipeline_created
=
create_pipeline!
if
should_create_pipeline?
if
should_create_pipeline?
cancel_pipeline_if_exist
pipeline_created
=
create_pipeline!
end
merge!
if
should_merge?
success
(
pipeline_created:
pipeline_created
.
present?
)
...
...
@@ -60,6 +64,12 @@ module MergeTrains
pipeline_absent?
||
require_recreate?
||
stale_pipeline?
end
def
cancel_pipeline_if_exist
return
unless
pipeline_for_merge_train
pipeline_for_merge_train
.
cancel_running
end
def
create_pipeline!
result
=
MergeTrains
::
CreatePipelineService
.
new
(
merge_request
.
project
,
merge_user
)
.
execute
(
merge_request
,
previous_ref
)
...
...
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