Allow transferring of projects with container repository tags
🌳 Overview
Extracted from the issue: Allow renaming/moving of origin repository thro... (#475001 - closed)
In #475000 (closed), we add a new feature to ContainerRegistry#GitlabAPIClient to enable the moving of the base repository.
In this issue, we then use that new feature to enable transferring groups or projects with container repository tags within the same top-level namespace.
Today, we block transferring groups or projects with container repository tags. And there are multiple places where we block them:
Groups::UpdateServiceGroups::TransferService-
Projects::TransferService👈 this issue is about.
Using the new method added to GitlabApiClient in #475000 (closed), we can then enable the transfer.
Note that the transfer is only allowed within the same top-level namespace, otherwise an error should be raised. There is also a dry_run parameter that we can harness to validate if the operation can succeed.
NOTE: This issue tackles Projects::TransferService.
🌱 Implementation Plan
NOTE: Only available when the GitlabAPI is available.
- In the above classes, we revisit the errors added when there are existing container repository tags.
- We start to add an if/else: if it's not the top level namespace being changed AND if a dry run succeeds (otherwise add another error), we allow it to continue, otherwise, maintain the existing error.
- When no other errors are present, execute the API call through
GitlabAPIClient