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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ffc576d7
Commit
ffc576d7
authored
Aug 28, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename MergeRequest#async_merge to merge_async
parent
9068083f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+2
-2
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/services/merge_requests/merge_when_pipeline_succeeds_service.rb
...es/merge_requests/merge_when_pipeline_succeeds_service.rb
+1
-1
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+2
-2
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
ffc576d7
...
@@ -318,14 +318,14 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -318,14 +318,14 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
elsif
@merge_request
.
head_pipeline
.
success?
elsif
@merge_request
.
head_pipeline
.
success?
# This can be triggered when a user clicks the auto merge button while
# This can be triggered when a user clicks the auto merge button while
# the tests finish at about the same time
# the tests finish at about the same time
@merge_request
.
async_merge
(
current_user
.
id
,
params
)
@merge_request
.
merge_async
(
current_user
.
id
,
params
)
:success
:success
else
else
:failed
:failed
end
end
else
else
@merge_request
.
async_merge
(
current_user
.
id
,
params
)
@merge_request
.
merge_async
(
current_user
.
id
,
params
)
:success
:success
end
end
...
...
app/models/merge_request.rb
View file @
ffc576d7
...
@@ -244,7 +244,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -244,7 +244,7 @@ class MergeRequest < ActiveRecord::Base
# Calls `MergeWorker` to proceed with the merge process and
# Calls `MergeWorker` to proceed with the merge process and
# updates `merge_jid` with the MergeWorker#jid.
# updates `merge_jid` with the MergeWorker#jid.
# This helps tracking enqueued and ongoing merge jobs.
# This helps tracking enqueued and ongoing merge jobs.
def
async_merge
(
user_id
,
params
)
def
merge_async
(
user_id
,
params
)
jid
=
MergeWorker
.
perform_async
(
id
,
user_id
,
params
)
jid
=
MergeWorker
.
perform_async
(
id
,
user_id
,
params
)
update_column
(
:merge_jid
,
jid
)
update_column
(
:merge_jid
,
jid
)
end
end
...
...
app/services/merge_requests/merge_when_pipeline_succeeds_service.rb
View file @
ffc576d7
...
@@ -30,7 +30,7 @@ module MergeRequests
...
@@ -30,7 +30,7 @@ module MergeRequests
next
next
end
end
merge_request
.
async_merge
(
merge_request
.
merge_user_id
,
merge_request
.
merge_params
)
merge_request
.
merge_async
(
merge_request
.
merge_user_id
,
merge_request
.
merge_params
)
end
end
end
end
...
...
app/services/merge_requests/update_service.rb
View file @
ffc576d7
...
@@ -83,7 +83,7 @@ module MergeRequests
...
@@ -83,7 +83,7 @@ module MergeRequests
if
merge_request
.
head_pipeline
&&
merge_request
.
head_pipeline
.
active?
if
merge_request
.
head_pipeline
&&
merge_request
.
head_pipeline
.
active?
MergeRequests
::
MergeWhenPipelineSucceedsService
.
new
(
project
,
current_user
).
execute
(
merge_request
)
MergeRequests
::
MergeWhenPipelineSucceedsService
.
new
(
project
,
current_user
).
execute
(
merge_request
)
else
else
merge_request
.
async_merge
(
current_user
.
id
,
{})
merge_request
.
merge_async
(
current_user
.
id
,
{})
end
end
end
end
...
...
spec/models/merge_request_spec.rb
View file @
ffc576d7
...
@@ -931,7 +931,7 @@ describe MergeRequest do
...
@@ -931,7 +931,7 @@ describe MergeRequest do
end
end
end
end
describe
'#
async_merge
'
do
describe
'#
merge_async
'
do
it
'enqueues MergeWorker job and updates merge_jid'
do
it
'enqueues MergeWorker job and updates merge_jid'
do
merge_request
=
create
(
:merge_request
)
merge_request
=
create
(
:merge_request
)
user_id
=
double
(
:user_id
)
user_id
=
double
(
:user_id
)
...
@@ -942,7 +942,7 @@ describe MergeRequest do
...
@@ -942,7 +942,7 @@ describe MergeRequest do
merge_jid
merge_jid
end
end
merge_request
.
async_merge
(
user_id
,
params
)
merge_request
.
merge_async
(
user_id
,
params
)
expect
(
merge_request
.
reload
.
merge_jid
).
to
eq
(
merge_jid
)
expect
(
merge_request
.
reload
.
merge_jid
).
to
eq
(
merge_jid
)
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