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
74332275
Commit
74332275
authored
Mar 04, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use legacy writer and seralizer in tree saver
- add sidekiq metrics exporter to import.rake task
parent
2b8e562a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
20 deletions
+11
-20
lib/gitlab/import_export/project/tree_saver.rb
lib/gitlab/import_export/project/tree_saver.rb
+11
-20
No files found.
lib/gitlab/import_export/project/tree_saver.rb
View file @
74332275
...
...
@@ -15,28 +15,23 @@ module Gitlab
end
def
save
project_tree
=
tree_saver
.
serialize
(
@project
,
reader
.
project_tree
)
fix_project_tree
(
project_tree
)
tree_saver
.
save
(
project_tree
,
@shared
.
export_path
,
ImportExport
.
project_filename
)
json_writer
=
ImportExport
::
JSON
::
LegacyWriter
.
new
(
File
.
join
(
@shared
.
export_path
,
"project.json"
))
serializer
=
ImportExport
::
JSON
::
StreamingSerializer
.
new
(
@project
,
reader
.
project_tree
,
json_writer
)
serializer
.
overrides
[
'description'
]
=
@params
[
:description
]
if
@params
[
:description
].
present?
serializer
.
additional_relations
[
'project_members'
]
=
group_members_array
serializer
.
execute
true
rescue
=>
e
@shared
.
error
(
e
)
false
#rescue => e
# @shared.error(e)
# false
ensure
json_writer
&
.
close
end
private
# Aware that the resulting hash needs to be pure-hash and
# does not include any AR objects anymore, only objects that run `.to_json`
def
fix_project_tree
(
project_tree
)
if
@params
[
:description
].
present?
project_tree
[
'description'
]
=
@params
[
:description
]
end
project_tree
[
'project_members'
]
+=
group_members_array
end
def
reader
@reader
||=
Gitlab
::
ImportExport
::
Reader
.
new
(
shared:
@shared
)
end
...
...
@@ -58,10 +53,6 @@ module Gitlab
GroupMembersFinder
.
new
(
@project
.
group
).
execute
.
where
.
not
(
user_id:
non_null_user_ids
)
end
def
tree_saver
@tree_saver
||=
RelationTreeSaver
.
new
end
end
end
end
...
...
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