Improve ADO projects staging with single repository
Overview
At the moment when we run congregate stage-projects projectID and there is only one repository in ADO's group (which during listing mapped to GitLab Project without parent namespace / subgroup).
Example:
[
{
"id": "1674c12f-e86f-4d6f-8993-98fe7a8a0ea8",
"name": "bridgecrewio-terragoat",
"namespace": "hello-world-project",
"path": "bridgecrewio-terragoat",
"path_with_namespace": "hello-world-project",
"visibility": "private",
"description": "",
"jobs_enabled": null,
"packages_enabled": null,
"project_type": "group",
"members": [
{
"email": "john.doe@gitlabpsoutlook.onmicrosoft.com",
"id": "aad.ZTlkMzM1NjgtZTZmMi03ZGVhLWI4ZmQtMzA4MzlmYjA2ODhm",
"name": "John Doe",
"state": "active",
"username": "john.doe"
},
{
"email": "adam.bijman@gitlabpsoutlook.onmicrosoft.com",
"id": "aad.NmEwOTg0ZWItYjI4Yy03YjVjLWJjZWItZTMwOTU3ZWQ2YTg4",
"name": "Adam Bijman",
"state": "active",
"username": "adam.bijman"
},
{
"email": "gitlab-ps@outlook.com",
"id": "aad.NzE0YzVlNTItMmU1OC03ODgwLWEzMGQtMmZiYjE2ODdjZTk1",
"name": "GitLab PS",
"state": "active",
"username": "gitlab.ps"
},
{
"email": "paul.van.windmill@gitlabpsoutlook.onmicrosoft.com",
"id": "aad.OTcwYTMwODktNTZjMC03ZmRiLWI1MDItYzIwZWVjM2Y1ZTM4",
"name": "Paul van Windmill",
"state": "active",
"username": "paul.van.windmill"
}
],
"http_url_to_repo": "https://gitlab-ps@dev.azure.com/gitlab-ps/Hello%20World%20Project/_git/bridgecrewio-terragoat",
"project_id": "d53abdc7-836e-4fd3-bc89-173d6c4a3108"
}
]
Such staged project does not have correct namespace and path_with_namespace.
Suggestion:
When we try to stage project that was originally single repository in ADO project we prepend namespace placeholder, like this:
...
"namespace": "<replace-this-with-valid-target-namespace>",
"path": "bridgecrewio-terragoat",
"path_with_namespace": "<replace-this-with-valid-target-namespace>/hello-world-project",
...
Tasks
-
Update docs if needed (workflow, runbooks, README, migration metrics, etc.)
Acceptance Criteria
-
Existing UTs pass locally -
100% code coverage on new code
@gitlab-org/professional-services-automation/tools/migration
Edited by Evgeny Rudinsky (GitLab)