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
46cbbbb3
Commit
46cbbbb3
authored
Jul 16, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit parent epic during an issue promotion
- changess to IssuePromoteService - update doc
parent
4713621d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
3 deletions
+33
-3
doc/user/group/epics/manage_epics.md
doc/user/group/epics/manage_epics.md
+1
-0
ee/app/services/epics/issue_promote_service.rb
ee/app/services/epics/issue_promote_service.rb
+6
-1
ee/changelogs/unreleased/199878-issue-promotion.yml
ee/changelogs/unreleased/199878-issue-promotion.yml
+5
-0
ee/spec/features/epics/issue_promotion_spec.rb
ee/spec/features/epics/issue_promotion_spec.rb
+5
-2
ee/spec/services/epics/issue_promote_service_spec.rb
ee/spec/services/epics/issue_promote_service_spec.rb
+16
-0
No files found.
doc/user/group/epics/manage_epics.md
View file @
46cbbbb3
...
...
@@ -271,6 +271,7 @@ The following issue metadata will be copied to the epic:
-
Upvotes/downvotes.
-
Participants.
-
Group labels that the issue already has.
-
Parent epic.
**(ULTIMATE)**
## Manage multi-level child epics **(ULTIMATE)**
...
...
ee/app/services/epics/issue_promote_service.rb
View file @
46cbbbb3
...
...
@@ -52,10 +52,15 @@ module Epics
def
params
{
title:
original_entity
.
title
title:
original_entity
.
title
,
parent:
issue_epic
}
end
def
issue_epic
original_entity
.
epic_issue
&
.
epic
end
def
add_note_from
SystemNoteService
.
issue_promoted
(
new_entity
,
original_entity
,
current_user
,
direction: :from
)
end
...
...
ee/changelogs/unreleased/199878-issue-promotion.yml
0 → 100644
View file @
46cbbbb3
---
title
:
Inherit parent epic during an issue promotion
merge_request
:
37109
author
:
type
:
changed
ee/spec/features/epics/issue_promotion_spec.rb
View file @
46cbbbb3
...
...
@@ -8,6 +8,8 @@ RSpec.describe 'Issue promotion', :js do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
group:
group
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:parent_epic
)
{
create
(
:epic
,
group:
group
)
}
let!
(
:epic_issue
)
{
create
(
:epic_issue
,
issue:
issue
,
epic:
parent_epic
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
...
...
@@ -21,7 +23,7 @@ RSpec.describe 'Issue promotion', :js do
expect
(
page
).
not_to
have_content
'Promoted issue to an epic.'
expect
(
issue
.
reload
).
to
be_open
expect
(
Epic
.
count
).
to
be_zero
expect
(
Epic
.
count
).
to
eq
(
1
)
end
end
...
...
@@ -39,7 +41,7 @@ RSpec.describe 'Issue promotion', :js do
expect
(
page
).
not_to
have_content
'Promoted issue to an epic.'
expect
(
issue
.
reload
).
to
be_open
expect
(
Epic
.
count
).
to
be_zero
expect
(
Epic
.
count
).
to
eq
(
1
)
end
end
...
...
@@ -70,6 +72,7 @@ RSpec.describe 'Issue promotion', :js do
expect
(
epic
.
title
).
to
eq
(
issue
.
title
)
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
expect
(
epic
.
author
).
to
eq
(
user
)
expect
(
epic
.
parent
).
to
eq
(
parent_epic
)
end
# Spec for https://gitlab.com/gitlab-org/gitlab/-/issues/215549
...
...
ee/spec/services/epics/issue_promote_service_spec.rb
View file @
46cbbbb3
...
...
@@ -69,6 +69,7 @@ RSpec.describe Epics::IssuePromoteService do
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
expect
(
epic
.
author
).
to
eq
(
user
)
expect
(
epic
.
group
).
to
eq
(
group
)
expect
(
epic
.
parent
).
to
be_nil
end
it
'copies group labels assigned to the issue'
do
...
...
@@ -104,6 +105,21 @@ RSpec.describe Epics::IssuePromoteService do
end
end
context
'when an issue belongs to an epic'
do
let
(
:parent_epic
)
{
create
(
:epic
,
group:
group
)
}
let!
(
:epic_issue
)
{
create
(
:epic_issue
,
epic:
parent_epic
,
issue:
issue
)
}
it
'creates a new epic with correct attributes'
do
subject
.
execute
(
issue
)
expect
(
epic
.
title
).
to
eq
(
issue
.
title
)
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
expect
(
epic
.
author
).
to
eq
(
user
)
expect
(
epic
.
group
).
to
eq
(
group
)
expect
(
epic
.
parent
).
to
eq
(
parent_epic
)
end
end
context
'when issue was already promoted'
do
it
'raises error'
do
epic
=
create
(
:epic
,
group:
group
)
...
...
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