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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3dd940ae
Commit
3dd940ae
authored
Apr 05, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
e54d7ee3
d793d4a7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
changelogs/unreleased/duplicate-related-mrs.yml
changelogs/unreleased/duplicate-related-mrs.yml
+5
-0
lib/api/issues.rb
lib/api/issues.rb
+1
-1
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+12
-0
No files found.
changelogs/unreleased/duplicate-related-mrs.yml
0 → 100644
View file @
3dd940ae
---
title
:
Remove duplicates from issue related merge requests
merge_request
:
27067
author
:
type
:
fixed
lib/api/issues.rb
View file @
3dd940ae
...
@@ -307,7 +307,7 @@ module API
...
@@ -307,7 +307,7 @@ module API
merge_requests
=
::
Issues
::
ReferencedMergeRequestsService
.
new
(
user_project
,
current_user
)
merge_requests
=
::
Issues
::
ReferencedMergeRequestsService
.
new
(
user_project
,
current_user
)
.
execute
(
issue
)
.
execute
(
issue
)
.
f
latten
.
f
irst
present
paginate
(
::
Kaminari
.
paginate_array
(
merge_requests
)),
present
paginate
(
::
Kaminari
.
paginate_array
(
merge_requests
)),
with:
Entities
::
MergeRequest
,
with:
Entities
::
MergeRequest
,
...
...
spec/requests/api/issues_spec.rb
View file @
3dd940ae
...
@@ -2193,6 +2193,18 @@ describe API::Issues do
...
@@ -2193,6 +2193,18 @@ describe API::Issues do
expect_paginated_array_response
(
related_mr
.
id
)
expect_paginated_array_response
(
related_mr
.
id
)
end
end
context
'merge request closes an issue'
do
let!
(
:closing_issue_mr_rel
)
do
create
(
:merge_requests_closing_issues
,
issue:
issue
,
merge_request:
related_mr
)
end
it
'returns closing MR only once'
do
get_related_merge_requests
(
project
.
id
,
issue
.
iid
,
user
)
expect_paginated_array_response
([
related_mr
.
id
])
end
end
context
'no merge request mentioned a issue'
do
context
'no merge request mentioned a issue'
do
it
'returns empty array'
do
it
'returns empty array'
do
get_related_merge_requests
(
project
.
id
,
closed_issue
.
iid
,
user
)
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