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
ee8cb2d1
Commit
ee8cb2d1
authored
Jun 15, 2018
by
Mario de la Ossa
Committed by
Alexandru Croitor
Mar 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PUT MergeRequest API endpoint - accept labels as an array
parent
c19c5197
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+2
-2
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+13
-0
No files found.
lib/api/merge_requests.rb
View file @
ee8cb2d1
...
...
@@ -179,8 +179,8 @@ module API
optional
:description
,
type:
String
,
desc:
'The description of the merge request'
optional
:assignee_id
,
type:
Integer
,
desc:
'The ID of a user to assign the merge request'
optional
:milestone_id
,
type:
Integer
,
desc:
'The ID of a milestone to assign the merge request'
optional
:labels
,
type:
String
,
desc:
'Comma-separated list of label names'
optional
:remove_source_branch
,
type:
Boolean
,
desc:
'
Delet
e source branch when merging'
optional
:labels
,
type:
String
,
coerce_with:
->
(
val
)
{
val
.
is_a?
(
Array
)
?
val
.
join
(
', '
)
:
val
},
desc:
'Comma-separated list of label names'
optional
:remove_source_branch
,
type:
Boolean
,
desc:
'
Remov
e source branch when merging'
optional
:allow_collaboration
,
type:
Boolean
,
desc:
'Allow commits from members who can merge to the target branch'
optional
:allow_maintainer_to_push
,
type:
Boolean
,
as: :allow_collaboration
,
desc:
'[deprecated] See allow_collaboration'
optional
:squash
,
type:
Grape
::
API
::
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
...
...
spec/requests/api/merge_requests_spec.rb
View file @
ee8cb2d1
...
...
@@ -1137,6 +1137,19 @@ describe API::MergeRequests do
expect
(
json_response
[
'labels'
]).
to
include
'&'
end
it
'also accepts labels as an array'
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
"
,
user
),
title:
'new issue'
,
labels:
[
'label'
,
'label?'
,
'label&foo'
,
'?'
,
'&'
]
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
[
'labels'
]).
to
include
'label'
expect
(
json_response
[
'labels'
]).
to
include
'label?'
expect
(
json_response
[
'labels'
]).
to
include
'label&foo'
expect
(
json_response
[
'labels'
]).
to
include
'?'
expect
(
json_response
[
'labels'
]).
to
include
'&'
end
it
'does not update state when title is empty'
do
put
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
"
,
user
),
params:
{
state_event:
'close'
,
title:
nil
}
...
...
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