Draft: Export tool to export group tree with projects
What does this MR do?
Related to: #241704 (closed)
To be able to ensure the projects namespace when importing the projects are created in directories that matches their group path.
Example
Given the following tree of groups with projects:
[gitlab][development] main:0> group.self_and_descendants.map { |group| [group, group.projects] }
=> [[#<Group id:99 @g1>, [#<Project id:82 g1/p1>>, #<Project id:83 g1/p2>>, #<Project id:84 g1/p3>>]],
[#<Group id:100 @g1/g1.1>, [#<Project id:85 g1/g1.1/p1>>, #<Project id:86 g1/g1.1/p2>>, #<Project id:87 g1/g1.1/p3>>]],
[#<Group id:101 @g1/g1.2>, [#<Project id:88 g1/g1.2/p1>>, #<Project id:89 g1/g1.2/p2>>, #<Project id:90 g1/g1.2/p3>>]],
[#<Group id:102 @g1/g1.1/g1.1.1>, [#<Project id:91 g1/g1.1/g1.1.1/p1>>, #<Project id:92 g1/g1.1/g1.1.1/p2>>, #<Project id:93 g1/g1.1/g1.1.1/p3>>]],
[#<Group id:103 @g1/g1.1/g1.1.2>, [#<Project id:94 g1/g1.1/g1.1.2/p1>>, #<Project id:95 g1/g1.1/g1.1.2/p2>>, #<Project id:96 g1/g1.1/g1.1.2/p3>>]],
[#<Group id:104 @g1/g1.2/g1.2.1>, [#<Project id:97 g1/g1.2/g1.2.1/p1>>, #<Project id:98 g1/g1.2/g1.2.1/p2>>, #<Project id:99 g1/g1.2/g1.2.1/p3>>]],
[#<Group id:105 @g1/g1.2/g1.2.2>, [#<Project id:100 g1/g1.2/g1.2.2/p1>>, #<Project id:101 g1/g1.2/g1.2.2/p2>>, #<Project id:102 g1/g1.2/g1.2.2/p3>>]]]
Running the command
$ rake "gitlab:restore:export[root,g1,/tmp/g1]"
# ...
I, [2020-08-31T17:36:35.408576 #53382] INFO -- : Export finished! /tmp/g1/2020-08-31_17-36-408_g1_export.tar.gz
The unpacked structure looks like
$ tree bundle
bundle
├── 2020-09-06_09-49-512_g1_export.tar.gz
└── projects
├── g1.1
│ ├── g1.1.1
│ │ ├── p1.tar.gz
│ │ ├── p2.tar.gz
│ │ └── p3.tar.gz
│ ├── g1.1.2
│ │ ├── p1.tar.gz
│ │ ├── p2.tar.gz
│ │ └── p3.tar.gz
│ ├── p1.tar.gz
│ ├── p2.tar.gz
│ └── p3.tar.gz
├── g1.2
│ ├── g1.2.1
│ │ ├── p1.tar.gz
│ │ ├── p2.tar.gz
│ │ └── p3.tar.gz
│ ├── g1.2.2
│ │ ├── p1.tar.gz
│ │ ├── p2.tar.gz
│ │ └── p3.tar.gz
│ ├── p1.tar.gz
│ ├── p2.tar.gz
│ └── p3.tar.gz
├── neoterm.tar.gz
├── p1.tar.gz
├── p2.tar.gz
└── p3.tar.gz
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Kassio Borges