Description
When running gh gl2gh migrate-repo to migrate a GitLab repository to a GitHub data residency (ghe.com) target (--target-api-url and --target-uploads-url are supplied) the migrate-repo command itself prints a hint after the migration completes (or fails) suggesting how to re-fetch the migration log. The link in this hint is incorrect, because it doesn't take the target-api-url into account. The migrationLogUrl in this code snippet doesn't have the correct URL and needs to be fixed:
|
var (migrationState, _, warningsCount, failureReason, migrationLogUrl) = await _githubApi.GetMigration(migrationId); |
|
|
|
while (RepositoryMigrationStatus.IsPending(migrationState)) |
|
{ |
|
_log.LogInformation($"Migration in progress (ID: {migrationId}). State: {migrationState}. Waiting 60 seconds..."); |
|
await Task.Delay(CHECK_MIGRATION_STATUS_DELAY_IN_MILLISECONDS); |
|
(migrationState, _, warningsCount, failureReason, migrationLogUrl) = await _githubApi.GetMigration(migrationId); |
|
} |
|
|
|
var migrationLogAvailableMessage = $"Migration log available at {migrationLogUrl} or by running `gh {CliContext.RootCommand} download-logs --github-org {args.GithubOrg} --github-repo {args.GithubRepo}`"; |
|
|
The download-logs command itself works correctly when --target-api-url is supplied. If a user copies and runs the suggested command from the hint of migrate-repo as-is, it defaults to https://api.github.com instead of the tenant's ghe.com API endpoint, so it queries the wrong GitHub instance and fails to find (or returns an incorrect) migration log.
Reproduction Steps
Run a regular GitLab to GitHub ghe.com migration and try to open the logs from the CLI.
Description
When running gh gl2gh migrate-repo to migrate a GitLab repository to a GitHub data residency (ghe.com) target (--target-api-url and --target-uploads-url are supplied) the migrate-repo command itself prints a hint after the migration completes (or fails) suggesting how to re-fetch the migration log. The link in this hint is incorrect, because it doesn't take the target-api-url into account. The migrationLogUrl in this code snippet doesn't have the correct URL and needs to be fixed:
gh-gei/src/gl2gh/Commands/MigrateRepo/MigrateRepoCommandHandler.cs
Lines 245 to 255 in b9b3fa1
The download-logs command itself works correctly when --target-api-url is supplied. If a user copies and runs the suggested command from the hint of migrate-repo as-is, it defaults to https://api.github.com instead of the tenant's ghe.com API endpoint, so it queries the wrong GitHub instance and fails to find (or returns an incorrect) migration log.
Reproduction Steps
Run a regular GitLab to GitHub ghe.com migration and try to open the logs from the CLI.