Allow project migrations to be created via API
Release notes
Migrating by direct transfer doesn't currently support migrating only projects. If during a group migration some projects fail to be migrated, it is not possible to re-import only chosen failed project. The workaround is to use import by uploading an export file, which always import only one project at a time.
With this release we enabling API-based migration of projects by direct transfer. This enables users to retry parts of migration that failed and prepares the possibility of migrating projects only in UI in the future.
Problem
Currently, Gitlab Direct transfer doesn't support the migration of only projects; therefore, if a project fails during the migration of the top-level group, the user can't use Gitlab Direct transfer to re-initiate only the migration of the failed projects. And the workaround is to use Import/Export, which by nature only migrates one project at a time.
The support for only project migrations in Gitlab Direct Transfer is planned to be done at Enable users to migrate only projects (&9755) epic, which will include the necessary UI changes.
This issue is an intermediary step to enable such migrations to be created via Direct transfer API allowing users to use Gitlab Direct transfer instead of Import/Export.
Solution
To support project migrations via API, we don't need to change the code much since the code is pretty much ready. However, we need to review the code to be sure validations are in place and make sure a malicious user can't explore such migrations.
Tech details
-
Enable project_entity in the API -
Get project name via GraphQL instead of using destination_slug (possibly already addressed with !115780 (merged)) -
Review/add model validations -
Review user's permissions. Only maintainers and above should be allowed -
Review if the user is allowed to create the project in the destination namespace -
Review if a malicious user can't leverage such migrations
Documentation
This should be documented, pointing to the benefit that the user can use Gitlab Direct transfer to re-initiate only the migration of the failed projects.
Addition in both user and API docs.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.