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
Boxiang Sun
gitlab-ce
Commits
7e14f86c
Commit
7e14f86c
authored
Mar 03, 2014
by
Greg Messner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added description parameter support to Create and Update MR API endpoints (issue-110).
parent
d0e73eec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
CHANGELOG
CHANGELOG
+1
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+4
-2
No files found.
CHANGELOG
View file @
7e14f86c
...
...
@@ -8,6 +8,7 @@ v 6.7.0
- Show contribution guide link for new issue form (Jeroen van Baarsen)
- Fix CI status for merge requests from fork
- Added option to remove issue assignee on project issue page and issue edit page (Jason Blanchard)
- Create and Update MR calls now support the description parameter (Greg Messner)
v 6.6.2
- Fix 500 error on branch/tag create or remove via UI
...
...
lib/api/merge_requests.rb
View file @
7e14f86c
...
...
@@ -64,6 +64,7 @@ module API
# target_project - The target project of the merge request defaults to the :id of the project
# assignee_id - Assignee user ID
# title (required) - Title of MR
# description - Description of MR
#
# Example:
# POST /projects/:id/merge_requests
...
...
@@ -72,7 +73,7 @@ module API
set_current_user_for_thread
do
authorize!
:write_merge_request
,
user_project
required_attributes!
[
:source_branch
,
:target_branch
,
:title
]
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:target_project_id
]
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:target_project_id
,
:description
]
merge_request
=
user_project
.
merge_requests
.
new
(
attrs
)
merge_request
.
author
=
current_user
merge_request
.
source_project
=
user_project
...
...
@@ -105,12 +106,13 @@ module API
# assignee_id - Assignee user ID
# title - Title of MR
# state_event - Status of MR. (close|reopen|merge)
# description - Description of MR
# Example:
# PUT /projects/:id/merge_request/:merge_request_id
#
put
":id/merge_request/:merge_request_id"
do
set_current_user_for_thread
do
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:state_event
]
attrs
=
attributes_for_keys
[
:source_branch
,
:target_branch
,
:assignee_id
,
:title
,
:state_event
,
:description
]
merge_request
=
user_project
.
merge_requests
.
find
(
params
[
:merge_request_id
])
authorize!
:modify_merge_request
,
merge_request
...
...
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