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
6e4fdc11
Commit
6e4fdc11
authored
Feb 14, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Directly use MRs given by ReferencedMergeRequestsService
parent
feb2cb90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
lib/api/issues.rb
lib/api/issues.rb
+5
-10
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+1
-1
No files found.
lib/api/issues.rb
View file @
6e4fdc11
...
...
@@ -304,19 +304,14 @@ module API
get
':id/issues/:issue_iid/related_merge_requests'
do
issue
=
find_project_issue
(
params
[
:issue_iid
])
merge_request
_iid
s
=
::
Issues
::
ReferencedMergeRequestsService
.
new
(
user_project
,
current_user
)
merge_requests
=
::
Issues
::
ReferencedMergeRequestsService
.
new
(
user_project
,
current_user
)
.
execute
(
issue
)
.
flatten
.
map
(
&
:iid
)
merge_requests
=
if
merge_request_iids
.
present?
MergeRequest
.
all
.
where
(
iid:
merge_request_iids
)
else
MergeRequest
.
none
end
present
paginate
(
merge_requests
),
with:
Entities
::
MergeRequestBasic
,
current_user:
current_user
,
project:
user_project
present
paginate
(
::
Kaminari
.
paginate_array
(
merge_requests
)),
with:
Entities
::
MergeRequestBasic
,
current_user:
current_user
,
project:
user_project
end
desc
'List merge requests closing issue'
do
...
...
spec/requests/api/issues_spec.rb
View file @
6e4fdc11
...
...
@@ -1835,7 +1835,7 @@ describe API::Issues do
get_related_merge_requests
(
project
.
id
,
issue
.
iid
,
user
)
expect_paginated_array_response
(
merge_request
.
id
)
expect_paginated_array_response
(
[
related_mr
.
id
,
merge_request
.
id
]
)
end
context
'no merge request mentioned a issue'
do
...
...
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