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
c04ea583
Commit
c04ea583
authored
May 20, 2019
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch '55127-add-delay-after-mr-creation-for-async-tasks-to-complete' into 'master'"
This reverts merge request !27978
parent
0c5b3d08
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
36 deletions
+0
-36
changelogs/unreleased/55127-add-delay-after-mr-creation-for-async-tasks-to-complete.yml
...d-delay-after-mr-creation-for-async-tasks-to-complete.yml
+0
-5
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+0
-4
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+0
-27
No files found.
changelogs/unreleased/55127-add-delay-after-mr-creation-for-async-tasks-to-complete.yml
deleted
100644 → 0
View file @
0c5b3d08
---
title
:
Wait for pipeline creation to complete before accepting a MR via API
merge_request
:
27978
author
:
kerrizor
type
:
fixed
lib/api/merge_requests.rb
View file @
c04ea583
...
@@ -367,10 +367,6 @@ module API
...
@@ -367,10 +367,6 @@ module API
merge_request
=
find_project_merge_request
(
params
[
:merge_request_iid
])
merge_request
=
find_project_merge_request
(
params
[
:merge_request_iid
])
merge_when_pipeline_succeeds
=
to_boolean
(
params
[
:merge_when_pipeline_succeeds
])
merge_when_pipeline_succeeds
=
to_boolean
(
params
[
:merge_when_pipeline_succeeds
])
if
merge_when_pipeline_succeeds
||
merge_request
.
merge_when_pipeline_succeeds
render_api_error!
(
'Not allowed: pipeline does not exist'
,
405
)
unless
merge_request
.
head_pipeline
end
# Merge request can not be merged
# Merge request can not be merged
# because user dont have permissions to push into target branch
# because user dont have permissions to push into target branch
unauthorized!
unless
merge_request
.
can_be_merged_by?
(
current_user
)
unauthorized!
unless
merge_request
.
can_be_merged_by?
(
current_user
)
...
...
spec/requests/api/merge_requests_spec.rb
View file @
c04ea583
...
@@ -1495,33 +1495,6 @@ describe API::MergeRequests do
...
@@ -1495,33 +1495,6 @@ describe API::MergeRequests do
expect
(
json_response
[
'merge_when_pipeline_succeeds'
]).
to
eq
(
true
)
expect
(
json_response
[
'merge_when_pipeline_succeeds'
]).
to
eq
(
true
)
end
end
context
'when the MR requires pipeline success'
do
it
'returns 405 if the pipeline is missing'
do
allow_any_instance_of
(
MergeRequest
)
.
to
receive
(
:merge_when_pipeline_succeeds
).
and_return
(
true
)
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:head_pipeline
).
and_return
(
nil
)
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/merge"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
405
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Not allowed: pipeline does not exist'
)
end
end
context
'when the request requires pipeline success'
do
it
'returns 405 if the pipeline is missing'
do
allow_any_instance_of
(
MergeRequest
)
.
to
receive
(
:merge_when_pipeline_succeeds
).
and_return
(
true
)
allow_any_instance_of
(
MergeRequest
).
to
receive
(
:head_pipeline
).
and_return
(
nil
)
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/merge"
,
user
),
params:
{
merge_when_pipeline_succeeds:
true
}
expect
(
response
).
to
have_gitlab_http_status
(
405
)
expect
(
json_response
[
'message'
]).
to
eq
(
'Not allowed: pipeline does not exist'
)
end
end
it
"returns 404 for an invalid merge request IID"
do
it
"returns 404 for an invalid merge request IID"
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/12345/merge"
,
user
)
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/12345/merge"
,
user
)
...
...
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