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
539694a3
Commit
539694a3
authored
Aug 18, 2017
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] changelog and minor style changes added
parent
d368b2d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
app/services/merge_requests/create_from_issue_service.rb
app/services/merge_requests/create_from_issue_service.rb
+1
-1
changelogs/unreleased/35343-inherit-milestones-and-labels.yml
...gelogs/unreleased/35343-inherit-milestones-and-labels.yml
+5
-0
spec/services/merge_requests/create_from_issue_service_spec.rb
...services/merge_requests/create_from_issue_service_spec.rb
+2
-2
No files found.
app/services/merge_requests/create_from_issue_service.rb
View file @
539694a3
...
...
@@ -3,7 +3,7 @@ module MergeRequests
def
execute
return
error
(
'Invalid issue iid'
)
unless
issue_iid
.
present?
&&
issue
.
present?
params
[
:label_ids
]
=
issue
.
label_ids
if
issue
.
label_ids
.
any?
params
[
:label_ids
]
=
issue
.
label_ids
if
issue
.
label_ids
.
any?
result
=
CreateBranchService
.
new
(
project
,
current_user
).
execute
(
branch_name
,
ref
)
return
result
if
result
[
:status
]
==
:error
...
...
changelogs/unreleased/35343-inherit-milestones-and-labels.yml
0 → 100644
View file @
539694a3
---
title
:
inherits milestone and labels when a merge request is created from issue
merge_request
:
13461
author
:
haseebeqx
type
:
added
spec/services/merge_requests/create_from_issue_service_spec.rb
View file @
539694a3
...
...
@@ -2,10 +2,10 @@ require 'spec_helper'
describe
MergeRequests
::
CreateFromIssueService
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:label_ids
)
{
create_pair
(
:label
,
project:
project
).
map
(
&
:id
)
}
let
(
:milestone_id
)
{
create
(
:milestone
,
project:
project
).
id
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone_id:
milestone_id
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone_id:
milestone_id
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
issue_iid:
issue
.
iid
)
}
...
...
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