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
d5e86f1a
Commit
d5e86f1a
authored
Aug 28, 2019
by
Sean Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify execute method
parent
dc22f476
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
ee/app/services/merge_trains/refresh_merge_request_service.rb
...pp/services/merge_trains/refresh_merge_request_service.rb
+11
-8
No files found.
ee/app/services/merge_trains/refresh_merge_request_service.rb
View file @
d5e86f1a
...
@@ -14,7 +14,17 @@ module MergeTrains
...
@@ -14,7 +14,17 @@ module MergeTrains
@merge_request
=
merge_request
@merge_request
=
merge_request
validate!
validate!
pipeline_created
=
create_or_replace_pipeline
merge!
if
should_merge?
success
(
pipeline_created:
pipeline_created
.
present?
)
rescue
ProcessError
=>
e
drop
(
e
)
end
private
def
create_or_replace_pipeline
if
should_create_pipeline?
if
should_create_pipeline?
previous_pipeline
=
pipeline_for_merge_train
previous_pipeline
=
pipeline_for_merge_train
pipeline_created
=
create_pipeline!
pipeline_created
=
create_pipeline!
...
@@ -22,16 +32,9 @@ module MergeTrains
...
@@ -22,16 +32,9 @@ module MergeTrains
previous_pipeline
.
auto_cancel_running
(
pipeline_created
)
previous_pipeline
.
auto_cancel_running
(
pipeline_created
)
end
end
end
end
pipeline_created
merge!
if
should_merge?
success
(
pipeline_created:
pipeline_created
.
present?
)
rescue
ProcessError
=>
e
drop
(
e
)
end
end
private
def
validate!
def
validate!
unless
project
.
merge_trains_enabled?
unless
project
.
merge_trains_enabled?
raise
ProcessError
,
'project disabled merge trains'
raise
ProcessError
,
'project disabled merge trains'
...
...
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