Refactor BulkImports tmpdir variable & update few validations
What does this MR do and why?
This MR:
- Updates BulkImport file download/decompression
dir
variable totmpdir
in order to align withArchiveExtraction
service. All 3 services expect temp directory to be used. Before this change 2 services had keyword argumentdir
while archive service hadtmpdir
. This change aligns them all to usetmpdir
- Updates
@tmp_dir
to@tmpdir
for consistency, since we usedtmp_dir
in some places andtmpdir
in others - Updates file download/decompression services to add a few more validations, similar to archive extraction service:
validate_tmpdir
updated to useFile.exapnd_path
and add newvalidate_filepath
to useGitlab::Utils.check_path_traversal!
- Updates tests for changed validations
- Adds class documentation to file download/decompression services, similar to archive extraction service
Mentions #339405 (closed)
- Group Migration is behind
bulk_import
feature flag, default enabled, currently disabled on .com - Project Migration is behid
bulk_import_projects
feature flag, default disabled & disabled on .com
Screenshots or screen recordings
https://monosnap.com/file/tURXbM9RxpDDoCdXkjnrMwW74AjnPy
How to set up and validate locally
-
Feature.enable(:bulk_import)
. -
Feature.enable(:bulk_import_projects)
. - Create a top level group and project in it.
- Create a few group epics/labels/miletones, project MRs/issues/comments/emojis/uploads
- Go to
/groups/new#import-group-pane
page and enter instance url and access token (needs to beapi
&read_repository
scope). - Select newly created group and click Import.
- Wait for Group import to complete and verify imported group & projects. Everything should still migrate as before
- Check
bulk_import_failures
table. It should contain no errors related to the changes.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by George Koltsov