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
7c5cef46
Commit
7c5cef46
authored
Jul 02, 2021
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not export certain models when using Relations Export API
Changelog: added
parent
ac7ce848
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
1 deletion
+21
-1
app/models/bulk_imports/file_transfer/base_config.rb
app/models/bulk_imports/file_transfer/base_config.rb
+5
-1
app/models/bulk_imports/file_transfer/group_config.rb
app/models/bulk_imports/file_transfer/group_config.rb
+4
-0
app/models/bulk_imports/file_transfer/project_config.rb
app/models/bulk_imports/file_transfer/project_config.rb
+4
-0
spec/models/bulk_imports/file_transfer/group_config_spec.rb
spec/models/bulk_imports/file_transfer/group_config_spec.rb
+4
-0
spec/models/bulk_imports/file_transfer/project_config_spec.rb
.../models/bulk_imports/file_transfer/project_config_spec.rb
+4
-0
No files found.
app/models/bulk_imports/file_transfer/base_config.rb
View file @
7c5cef46
...
...
@@ -30,7 +30,7 @@ module BulkImports
end
def
portable_relations
import_export_config
.
dig
(
:tree
,
portable_class_sym
).
keys
.
map
(
&
:to_s
)
import_export_config
.
dig
(
:tree
,
portable_class_sym
).
keys
.
map
(
&
:to_s
)
-
skipped_relations
end
private
...
...
@@ -66,6 +66,10 @@ module BulkImports
def
base_export_path
raise
NotImplementedError
end
def
skipped_relations
[]
end
end
end
end
app/models/bulk_imports/file_transfer/group_config.rb
View file @
7c5cef46
...
...
@@ -10,6 +10,10 @@ module BulkImports
def
import_export_yaml
::
Gitlab
::
ImportExport
.
group_config_file
end
def
skipped_relations
@skipped_relations
||=
%w(members)
end
end
end
end
app/models/bulk_imports/file_transfer/project_config.rb
View file @
7c5cef46
...
...
@@ -10,6 +10,10 @@ module BulkImports
def
import_export_yaml
::
Gitlab
::
ImportExport
.
config_file
end
def
skipped_relations
@skipped_relations
||=
%w(project_members group_members)
end
end
end
end
spec/models/bulk_imports/file_transfer/group_config_spec.rb
View file @
7c5cef46
...
...
@@ -34,6 +34,10 @@ RSpec.describe BulkImports::FileTransfer::GroupConfig do
it
'returns a list of top level exportable relations'
do
expect
(
subject
.
portable_relations
).
to
include
(
'milestones'
,
'badges'
,
'boards'
,
'labels'
)
end
it
'does not include skipped relations'
do
expect
(
subject
.
portable_relations
).
not_to
include
(
'members'
)
end
end
describe
'#top_relation_tree'
do
...
...
spec/models/bulk_imports/file_transfer/project_config_spec.rb
View file @
7c5cef46
...
...
@@ -34,6 +34,10 @@ RSpec.describe BulkImports::FileTransfer::ProjectConfig do
it
'returns a list of top level exportable relations'
do
expect
(
subject
.
portable_relations
).
to
include
(
'issues'
,
'labels'
,
'milestones'
,
'merge_requests'
)
end
it
'does not include skipped relations'
do
expect
(
subject
.
portable_relations
).
not_to
include
(
'project_members'
,
'group_members'
)
end
end
describe
'#top_relation_tree'
do
...
...
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