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
f0beda36
Commit
f0beda36
authored
Dec 10, 2019
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more relations to Group Export
parent
cb4aae5f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
4 deletions
+60
-4
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
+43
-3
lib/gitlab/import_export/group_import_export.yml
lib/gitlab/import_export/group_import_export.yml
+17
-1
No files found.
ee/spec/lib/ee/gitlab/import_export/group_tree_saver_spec.rb
View file @
f0beda36
...
...
@@ -6,10 +6,16 @@ describe Gitlab::ImportExport::GroupTreeSaver do
describe
'saves the group tree into a json object'
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:label
)
{
create
(
:group_label
)
}
let_it_be
(
:parent_epic
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
,
parent:
parent_epic
)
}
let_it_be
(
:board
)
{
create
(
:board
,
group:
group
,
assignee:
user
,
labels:
[
label
])
}
let_it_be
(
:note
)
{
create
(
:note
,
noteable:
epic
)
}
let
(
:shared
)
{
Gitlab
::
ImportExport
::
Shared
.
new
(
group
)
}
let
(
:export_path
)
{
"
#{
Dir
.
tmpdir
}
/group_tree_saver_spec_ee"
}
let
(
:group_tree_saver
)
{
described_class
.
new
(
group:
group
,
current_user:
user
,
shared:
shared
)
}
let
(
:saved_group_json
)
do
group_tree_saver
.
save
group_json
(
group_tree_saver
.
full_path
)
...
...
@@ -27,8 +33,42 @@ describe Gitlab::ImportExport::GroupTreeSaver do
expect
(
group_tree_saver
.
save
).
to
be
true
end
it
'saves epics'
do
expect
(
saved_group_json
[
'epics'
].
size
).
to
eq
(
1
)
context
'epics relation'
do
it
'saves top level epics'
do
expect
(
saved_group_json
[
'epics'
].
size
).
to
eq
(
2
)
end
it
'saves parent of epic'
do
parent
=
saved_group_json
[
'epics'
].
first
[
'parent'
]
expect
(
parent
).
not_to
be_empty
expect
(
parent
[
'id'
]).
to
eq
(
parent_epic
.
id
)
end
it
'saves epic notes'
do
notes
=
saved_group_json
[
'epics'
].
first
[
'notes'
]
expect
(
notes
).
not_to
be_empty
expect
(
notes
.
first
[
'note'
]).
to
eq
(
note
.
note
)
expect
(
notes
.
first
[
'noteable_id'
]).
to
eq
(
epic
.
id
)
end
end
context
'boards relation'
do
it
'saves top level boards'
do
expect
(
saved_group_json
[
'boards'
].
size
).
to
eq
(
1
)
end
it
'saves board assignee'
do
expect
(
saved_group_json
[
'boards'
].
first
[
'board_assignee'
][
'assignee_id'
]).
to
eq
(
user
.
id
)
end
it
'saves board labels'
do
labels
=
saved_group_json
[
'boards'
].
first
[
'labels'
]
expect
(
labels
).
not_to
be_empty
expect
(
labels
.
first
[
'title'
]).
to
eq
(
label
.
title
)
end
end
end
...
...
lib/gitlab/import_export/group_import_export.yml
View file @
f0beda36
...
...
@@ -14,9 +14,16 @@ tree:
-
:user
included_attributes
:
user
:
-
:id
-
:email
-
:username
author
:
-
:name
excluded_attributes
:
group
:
-
:id
-
:runners_token
-
:runners_token_encrypted
...
...
@@ -25,6 +32,8 @@ methods:
-
:type
badges
:
-
:type
notes
:
-
:type
preloads
:
...
...
@@ -33,4 +42,11 @@ preloads:
ee
:
tree
:
group
:
-
:epics
-
epics
:
-
:parent
-
notes
:
-
:author
-
boards
:
-
:board_assignee
-
labels
:
-
:priorities
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