Skip to content

Fix overwrite check in GitLab import/export

Stan Hu requested to merge sh-fix-overwrite-import-export-check into master

In gitlab-foss!17883 (merged), we added a feature that would allow a project export to be uploaded and imported successfully before deleting the old copy of the project.

This overwrite feature would always check whether the user had owner privileges in the group of the project. If the user only had maintainer privileges or less--even if an overwrite was not happening--the import/export would fail with an empty Projects::ImportService::Error.

To fix this, we make two changes:

  1. Only do the permission check if we actually need to overwrite the project.
  2. If the permission check fails, raise an exception with details.
Edited by 🤖 GitLab Bot 🤖

Merge request reports