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
feb2cb90
Commit
feb2cb90
authored
Feb 13, 2019
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: Reference MRs cross-project wise
parent
7a8f8714
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
lib/api/issues.rb
lib/api/issues.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+10
-1
No files found.
lib/api/issues.rb
View file @
feb2cb90
...
...
@@ -311,7 +311,7 @@ module API
merge_requests
=
if
merge_request_iids
.
present?
MergeRequest
sFinder
.
new
(
current_user
,
project_id:
user_project
.
id
,
iids:
merge_request_iids
).
execute
MergeRequest
.
all
.
where
(
iid:
merge_request_iids
)
else
MergeRequest
.
none
end
...
...
spec/requests/api/issues_spec.rb
View file @
feb2cb90
...
...
@@ -1792,7 +1792,7 @@ describe API::Issues do
description:
"See
#{
issue
.
to_reference
}
"
}
create
(
:merge_request
,
attributes
).
tap
do
|
merge_request
|
create
(
:note
,
:system
,
project:
project
,
noteable:
issue
,
author:
user
,
note:
merge_request
.
to_reference
(
full:
true
))
create
(
:note
,
:system
,
project:
issue
.
project
,
noteable:
issue
,
author:
user
,
note:
merge_request
.
to_reference
(
full:
true
))
end
end
...
...
@@ -1829,6 +1829,15 @@ describe API::Issues do
expect_paginated_array_response
(
related_mr
.
id
)
end
it
'returns merge requests cross-project wide'
do
project2
=
create
(
:project
,
:public
,
creator_id:
user
.
id
,
namespace:
user
.
namespace
)
merge_request
=
create_referencing_mr
(
user
,
project2
,
issue
)
get_related_merge_requests
(
project
.
id
,
issue
.
iid
,
user
)
expect_paginated_array_response
(
merge_request
.
id
)
end
context
'no merge request mentioned a issue'
do
it
'returns empty array'
do
get_related_merge_requests
(
project
.
id
,
closed_issue
.
iid
,
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