-
Notifications
You must be signed in to change notification settings - Fork 110
--target-api-url
support for migrate repo and org
#1214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
bac1a3f
169c0c8
ee49ff9
a5a98a0
546800b
336cf3d
29c4bee
54c56e8
dae236b
a9441bd
cf1d3d9
833931b
915aead
1bb6bec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
- Add `--target-api-url` to `ado2gh migrate repo`, `bbs2gh migrate repo`, and `gei migrate org` to support newer GitHub migration paths. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ public class MigrateRepoCommandHandlerTests | |
private const string ADO_REPO = "foo-repo"; | ||
private const string GITHUB_ORG = "foo-gh-org"; | ||
private const string GITHUB_REPO = "gh-repo"; | ||
private const string TARGET_API_URL = "https://api.github.com"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will add a comment just for this line but it applies to all tests for all CLIs. There is no need to add the target api url here because it's only going to be used inside the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new tests are going to be similar to this one |
||
private readonly string ADO_REPO_URL = $"https://dev.azure.com/{ADO_ORG}/{ADO_TEAM_PROJECT}/_git/{ADO_REPO}"; | ||
private readonly string ADO_TOKEN = Guid.NewGuid().ToString(); | ||
private readonly string GITHUB_ORG_ID = Guid.NewGuid().ToString(); | ||
|
@@ -83,6 +84,7 @@ public async Task Happy_Path() | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
QueueOnly = true, | ||
}; | ||
await _handler.Handle(args); | ||
|
@@ -115,6 +117,7 @@ public async Task Ado_Server_Migration() | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
QueueOnly = true, | ||
AdoServerUrl = ADO_SERVER_URL, | ||
GithubPat = GITHUB_TOKEN, | ||
|
@@ -168,6 +171,7 @@ public async Task Skip_Migration_If_Target_Repo_Exists() | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
QueueOnly = true, | ||
}; | ||
await _handler.Handle(args); | ||
|
@@ -212,6 +216,7 @@ public async Task Happy_Path_With_Wait() | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
}; | ||
await _handler.Handle(args); | ||
|
||
|
@@ -242,6 +247,7 @@ await _handler.Invoking(async x => await x.Handle(new MigrateRepoCommandArgs | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
})) | ||
.Should() | ||
.ThrowAsync<OctoshiftCliException>() | ||
|
@@ -268,6 +274,7 @@ public async Task It_Falls_Back_To_Ado_And_Github_Pats_From_Environment_When_Not | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
}; | ||
|
||
await _handler.Handle(args); | ||
|
@@ -291,6 +298,7 @@ public async Task Sets_Target_Repo_Visibility_When_Specified() | |
AdoRepo = ADO_REPO, | ||
GithubOrg = GITHUB_ORG, | ||
GithubRepo = GITHUB_REPO, | ||
TargetApiUrl = TARGET_API_URL, | ||
QueueOnly = true, | ||
TargetRepoVisibility = targetRepoVisibility, | ||
}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ public void Should_Have_Options() | |
var command = new MigrateOrgCommand(); | ||
command.Should().NotBeNull(); | ||
command.Name.Should().Be("migrate-org"); | ||
command.Options.Count.Should().Be(7); | ||
command.Options.Count.Should().Be(8); | ||
|
||
TestHelpers.VerifyCommandOption(command.Options, "github-source-org", true); | ||
TestHelpers.VerifyCommandOption(command.Options, "github-target-org", true); | ||
|
@@ -21,6 +21,7 @@ public void Should_Have_Options() | |
TestHelpers.VerifyCommandOption(command.Options, "github-source-pat", false); | ||
TestHelpers.VerifyCommandOption(command.Options, "github-target-pat", false); | ||
TestHelpers.VerifyCommandOption(command.Options, "verbose", false); | ||
TestHelpers.VerifyCommandOption(command.Options, "target-api-url", false); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A similar test to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay will add tomorrow, thanks for the quick feedback! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ArinGhazarian added in 833931b, also note I was following the gei spec which originally added this flag, hence why I added test in handler to begin with but thanks for catching it 👍🏾 https://github.com/github/gh-gei/blob/main/src/OctoshiftCLI.Tests/gei/Commands/MigrateRepo/MigrateRepoCommandTests.cs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah a lot has changed in the CLI since then mostly because the underlying |
||
} | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.