github / github/gh-gei

ado2gh expects a team name in URL

Open
#1,262 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
478
Forks
146
Avg merge
7d 21h
Merged PRs (30d)
2

Description

## Description

After creating a repo in ADO, the repo URL looks like this `https://dev.azure.com//_git/`.

However, ado2gh cli seems to expect the team name to be part of the repo URL, such as:
`https://dev.azure.com///_git/`

The URL returned in the error message (containing the team name) does not exist and the command fails with "source repository does not exist or you do not have permissions".

Unfortunately the cli forces the parameter `--ado-team-project` to be specified. Then even if I specify an empty string `''`, the result is still `https://dev.azure.com///_git/` which is even more incorrect.

## Reproduction Steps
Assuming you have admin on both ADO and GH, and PATs for both tools loaded on the env vars:
1. Create a git repo in ADO
2. Run: `gh ado2gh migrate-repo --ado-org --ado-repo --github-org --github-repo --ado-team-project `

## Error msg:

````
[2024-09-06 13:39:20] [ERROR] Migration Failed. Migration ID: RM_kgDaACQ1NDk4NjJlOC04YzNhLTRjODgtODA2NS0yZjg2Zjg3N2NhNGQ
[2024-09-06 13:39:20] [INFO] Migration log available at or by running `gh ado2gh download-logs --github-org target-org3 --github-repo adorepo2gh`
[2024-09-06 13:39:20] [ERROR] OctoshiftCLI.OctoshiftCliException: The source repository does not exist or you do not have permissions. Please ensure https://dev.azure.com/ado-org/renan-team/_git/new-ado-repo is the correct source url.
at OctoshiftCLI.AdoToGithub.Commands.MigrateRepo.MigrateRepoCommandHandler.Handle(MigrateRepoCommandArgs args)
at OctoshiftCLI.Extensions.CommandExtensions.RunHandler[TArgs,THandler](TArgs args, ServiceProvider sp, CommandBase`2 command)
at OctoshiftCLI.Extensions.CommandExtensions.<>c__DisplayClass1_0`3.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.AnonymousCommandHandler.InvokeAsync(InvocationContext )
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass17_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass12_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass22_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass19_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__18_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<b__5_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()

````

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.