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
e6b80ea8
Commit
e6b80ea8
authored
Jan 30, 2020
by
George Koltsov
Committed by
Stan Hu
Jan 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add award emojis to Epics on Group Export
parent
6db44dad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
1 deletion
+86
-1
changelogs/unreleased/georgekoltsov-add-award-emoji-to-notes-of-epics.yml
...eased/georgekoltsov-add-award-emoji-to-notes-of-epics.yml
+5
-0
ee/spec/lib/ee/gitlab/import_export/group_tree_restorer_spec.rb
...c/lib/ee/gitlab/import_export/group_tree_restorer_spec.rb
+40
-0
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
+16
-0
lib/gitlab/import_export/group_import_export.yml
lib/gitlab/import_export/group_import_export.yml
+2
-0
spec/fixtures/lib/gitlab/import_export/group_exports/complex/group.json
...lib/gitlab/import_export/group_exports/complex/group.json
+23
-1
No files found.
changelogs/unreleased/georgekoltsov-add-award-emoji-to-notes-of-epics.yml
0 → 100644
View file @
e6b80ea8
---
title
:
Add award emoji information of Epics and Epic Notes to Group Import/Export
merge_request
:
24003
author
:
type
:
changed
ee/spec/lib/ee/gitlab/import_export/group_tree_restorer_spec.rb
0 → 100644
View file @
e6b80ea8
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
ImportExport
::
GroupTreeRestorer
do
include
ImportExport
::
CommonUtil
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
,
name:
'group'
,
path:
'group'
)
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
group
)
}
let
(
:group_tree_restorer
)
{
described_class
.
new
(
user:
user
,
shared:
shared
,
group:
group
,
group_hash:
nil
)
}
before
do
setup_import_export_config
(
'group_exports/complex'
)
group
.
add_owner
(
user
)
group_tree_restorer
.
restore
end
describe
'restore group tree'
do
context
'epics'
do
it
'has group epics'
do
expect
(
group
.
epics
.
count
).
to
eq
(
5
)
end
it
'has award emoji'
do
expect
(
group
.
epics
.
first
.
award_emoji
.
first
.
name
).
to
eq
(
'thumbsup'
)
end
end
context
'epic notes'
do
it
'has epic notes'
do
expect
(
group
.
epics
.
first
.
notes
.
count
).
to
eq
(
4
)
end
it
'has award emoji on epic notes'
do
expect
(
group
.
epics
.
first
.
notes
.
first
.
award_emoji
.
first
.
name
).
to
eq
(
'drum'
)
end
end
end
end
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
View file @
e6b80ea8
...
...
@@ -14,6 +14,8 @@ describe Gitlab::ImportExport::GroupTreeSaver do
let_it_be
(
:board
)
{
create
(
:board
,
group:
group
,
assignee:
user
,
labels:
[
label
])
}
let_it_be
(
:note
)
{
create
(
:note
,
noteable:
epic
)
}
let_it_be
(
:note_event
)
{
create
(
:event
,
:created
,
target:
note
,
author:
user
)
}
let_it_be
(
:epic_emoji
)
{
create
(
:award_emoji
,
awardable:
epic
)
}
let_it_be
(
:epic_note_emoji
)
{
create
(
:award_emoji
,
awardable:
note
)
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
group
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/group_tree_saver_spec_ee"
}
...
...
@@ -82,6 +84,20 @@ describe Gitlab::ImportExport::GroupTreeSaver do
notes
=
epic_json
[
'notes'
]
expect
(
notes
.
first
[
'events'
].
first
[
'action'
]).
to
eq
(
note_event
.
action
)
end
it
"saves epic's award emojis"
do
expect_successful_save
(
group_tree_saver
)
award_emoji
=
epic_json
[
'award_emoji'
].
first
expect
(
award_emoji
[
'name'
]).
to
eq
(
epic_emoji
.
name
)
end
it
"saves epic's note award emojis"
do
expect_successful_save
(
group_tree_saver
)
award_emoji
=
epic_json
[
'notes'
].
first
[
'award_emoji'
].
first
expect
(
award_emoji
[
'name'
]).
to
eq
(
epic_note_emoji
.
name
)
end
end
context
'boards relation'
do
...
...
lib/gitlab/import_export/group_import_export.yml
View file @
e6b80ea8
...
...
@@ -46,10 +46,12 @@ ee:
group
:
-
epics
:
-
:parent
-
:award_emoji
-
events
:
-
:push_event_payload
-
notes
:
-
:author
-
:award_emoji
-
events
:
-
:push_event_payload
-
boards
:
...
...
spec/fixtures/lib/gitlab/import_export/group_exports/complex/group.json
View file @
e6b80ea8
...
...
@@ -482,7 +482,18 @@
"type"
:
null
,
"author"
:
{
"name"
:
"Administrator"
},
"award_emoji"
:
[
{
"id"
:
12
,
"name"
:
"drum"
,
"user_id"
:
1
,
"awardable_type"
:
"Note"
,
"awardable_id"
:
44170
,
"created_at"
:
"2019-11-05T15:32:21.287Z"
,
"updated_at"
:
"2019-11-05T15:32:21.287Z"
}
]
},
{
"id"
:
44168
,
...
...
@@ -574,6 +585,17 @@
"name"
:
"Administrator"
}
}
],
"award_emoji"
:
[
{
"id"
:
12
,
"name"
:
"thumbsup"
,
"user_id"
:
1
,
"awardable_type"
:
"Epic"
,
"awardable_id"
:
13622
,
"created_at"
:
"2019-11-05T15:37:21.287Z"
,
"updated_at"
:
"2019-11-05T15:37:21.287Z"
}
]
},
{
...
...
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