Skip to content

Commit

Permalink
Merge pull request #1269 from github/gso-option
Browse files Browse the repository at this point in the history
PART1: Add `use-github-storage` option
  • Loading branch information
begonaguereca authored Sep 27, 2024
2 parents 7b43293 + 95844ea commit 1a5e198
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void Should_Have_Options()
var command = new MigrateRepoCommand();
command.Should().NotBeNull();
command.Name.Should().Be("migrate-repo");
command.Options.Count.Should().Be(31);
command.Options.Count.Should().Be(32);

TestHelpers.VerifyCommandOption(command.Options, "bbs-server-url", true);
TestHelpers.VerifyCommandOption(command.Options, "bbs-project", true);
Expand Down Expand Up @@ -88,6 +88,7 @@ public void Should_Have_Options()
TestHelpers.VerifyCommandOption(command.Options, "keep-archive", false);
TestHelpers.VerifyCommandOption(command.Options, "no-ssl-verify", false);
TestHelpers.VerifyCommandOption(command.Options, "target-api-url", false);
TestHelpers.VerifyCommandOption(command.Options, "use-github-storage", false, true);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void Should_Have_Options()

command.Should().NotBeNull();
command.Name.Should().Be("migrate-repo");
command.Options.Count.Should().Be(23);
command.Options.Count.Should().Be(24);

TestHelpers.VerifyCommandOption(command.Options, "github-source-org", true);
TestHelpers.VerifyCommandOption(command.Options, "source-repo", true);
Expand All @@ -37,6 +37,7 @@ public void Should_Have_Options()
TestHelpers.VerifyCommandOption(command.Options, "github-target-pat", false);
TestHelpers.VerifyCommandOption(command.Options, "verbose", false);
TestHelpers.VerifyCommandOption(command.Options, "keep-archive", false);
TestHelpers.VerifyCommandOption(command.Options, "use-github-storage", false, true);
}
}
}
5 changes: 5 additions & 0 deletions src/bbs2gh/Commands/MigrateRepo/MigrateRepoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public MigrateRepoCommand() : base(
AddOption(KeepArchive);
AddOption(NoSslVerify);
AddOption(TargetApiUrl);
AddOption(UseGithubStorage);
}

public Option<string> BbsServerUrl { get; } = new(
Expand Down Expand Up @@ -191,6 +192,10 @@ public MigrateRepoCommand() : base(
name: "--no-ssl-verify",
description: "Disables SSL verification when communicating with your Bitbucket Server/Data Center instance. All other migration steps will continue to verify SSL. " +
"If your Bitbucket instance has a self-signed SSL certificate then setting this flag will allow the migration archive to be exported.");
public Option<bool> UseGithubStorage { get; } = new(
name: "--use-github-storage",
description: "Enables multipart uploads to a GitHub owned storage for use during migration")
{ IsHidden = true };

public override MigrateRepoCommandHandler BuildHandler(MigrateRepoCommandArgs args, IServiceProvider sp)
{
Expand Down
6 changes: 6 additions & 0 deletions src/gei/Commands/MigrateRepo/MigrateRepoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public MigrateRepoCommand() : base(
AddOption(GithubTargetPat);
AddOption(Verbose);
AddOption(KeepArchive);
AddOption(UseGithubStorage);
}

public Option<string> GithubSourceOrg { get; } = new("--github-source-org")
Expand Down Expand Up @@ -102,6 +103,11 @@ public MigrateRepoCommand() : base(
{
Description = "Only effective if migrating from GHES. Disables SSL verification when communicating with your GHES instance. All other migration steps will continue to verify SSL. If your GHES instance has a self-signed SSL certificate then setting this flag will allow data to be extracted."
};
public Option<bool> UseGithubStorage { get; } = new("--use-github-storage")
{
IsHidden = true,
Description = "Enables multipart uploads to a GitHub owned storage for use during migration",
};

// Pre-uploaded archive urls, hidden by default
public Option<string> GitArchiveUrl { get; } = new("--git-archive-url")
Expand Down

0 comments on commit 1a5e198

Please sign in to comment.