[EE] Fix project exports clobbering concurrent export paths
When a project export completes, it removes everything in
Project#import_export_shared.archive_path
, which can erase files
needed for another, ongoing project export. This is problematic for
custom templates, which exports an existing project to get the most
recent changes and imports that archive to another project.
To avoid this from happening, we generate a random unique subpath in the shared temporary directory so that multiple exports can work at the same time.
Closes #14716 (closed)
Testing Matrix
Test | Export dir deleted? | Locks deleted? | Correct status? | Pass? |
---|---|---|---|---|
Project export | ||||
2 simultaneous project exports |
|
|||
Project export w/ Web upload | ||||
1 Project creation w/ custom template | ||||
3 simultaneous project creations w/ custom template |
Testing methodology
With !16352 (merged), we can now create projects with custom templates via the API, which makes it easy to run tests that require parallelization. For example, to test 3 simultaneous project creations, we can do something like:
curl -v -X POST -H "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" "http://localhost:3001/api/v4/projects?name=parallel1&path=parallel1&use_custom_template=true&template_name=flight" &
curl -v -X POST -H "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" "http://localhost:3001/api/v4/projects?name=parallel2&path=parallel2&use_custom_template=true&template_name=flight" &
curl -v -X POST -H "PRIVATE-TOKEN: ${PRIVATE_TOKEN}" "http://localhost:3001/api/v4/projects?name=parallel3&path=parallel3&use_custom_template=true&template_name=flight" &
Edited by 🤖 GitLab Bot 🤖