Skip to content
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

Log the git and metadata archive paths after the download is complete #1325

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@

- `gh gei migrate-repo` logs the git and metadata archive download paths when `--keep-archive` is used.
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ await _handler.Invoking(async x => await x.Handle(new MigrateRepoCommandArgs
}

[Fact]
public async Task Keep_Archive_Does_Not_Call_DeleteIfExists()
public async Task Keep_Archive_Does_Not_Call_DeleteIfExists_And_Logs_Downloaded_Archive_Paths()
{
_mockTargetGithubApi.Setup(x => x.GetOrganizationId(TARGET_ORG).Result).Returns(GITHUB_ORG_ID);
_mockTargetGithubApi.Setup(x => x.CreateGhecMigrationSource(GITHUB_ORG_ID).Result).Returns(MIGRATION_SOURCE_ID);
Expand Down Expand Up @@ -1737,6 +1737,9 @@ public async Task Keep_Archive_Does_Not_Call_DeleteIfExists()

_mockFileSystemProvider.Verify(x => x.DeleteIfExists(GIT_ARCHIVE_FILE_PATH), Times.Never);
_mockFileSystemProvider.Verify(x => x.DeleteIfExists(METADATA_ARCHIVE_FILE_PATH), Times.Never);

_mockOctoLogger.Verify(x => x.LogInformation($"Git archive was successfully downloaded at \"{GIT_ARCHIVE_FILE_PATH}\""));
_mockOctoLogger.Verify(x => x.LogInformation($"Metadata archive was successfully downloaded at \"{METADATA_ARCHIVE_FILE_PATH}\""));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion src/gei/Commands/MigrateRepo/MigrateRepoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public MigrateRepoCommand() : base(

public Option<bool> KeepArchive { get; } = new("--keep-archive")
{
Description = "Keeps the archive on this machine after uploading to the blob storage account. Only applicable for migrations from GitHub Enterprise Server versions before 3.8.0."
Description = "Keeps the archive on this machine after uploading to the blob storage account. Only applicable for migrations from GitHub Enterprise Server versions before 3.8.0 or when used with --use-github-storage."
};

public override MigrateRepoCommandHandler BuildHandler(MigrateRepoCommandArgs args, IServiceProvider sp)
Expand Down
4 changes: 2 additions & 2 deletions src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ private string ExtractGhesBaseUrl(string ghesApiUrl)
{
_log.LogInformation($"Downloading archive from {gitArchiveUrl}");
await _httpDownloadService.DownloadToFile(gitArchiveUrl, gitArchiveDownloadFilePath);
_log.LogInformation("Download complete");
_log.LogInformation(keepArchive ? $"Git archive was successfully downloaded at \"{gitArchiveDownloadFilePath}\"" : "Download complete");

_log.LogInformation($"Downloading archive from {metadataArchiveUrl}");
await _httpDownloadService.DownloadToFile(metadataArchiveUrl, metadataArchiveDownloadFilePath);
_log.LogInformation("Download complete");
_log.LogInformation(keepArchive ? $"Metadata archive was successfully downloaded at \"{metadataArchiveDownloadFilePath}\"" : "Download complete");

return (
await UploadArchive(
Expand Down
Loading