Skip to content

Commit b8b7890

Browse files
Merge pull request #1325 from github/log-downloaded-archive-path-in-gei-migrate-repo
Log the git and metadata archive paths after the download is complete
2 parents 53020ff + c4b2d5b commit b8b7890

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

RELEASENOTES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
- `gh gei migrate-repo` logs the git and metadata archive download paths when `--keep-archive` is used.

src/OctoshiftCLI.Tests/gei/Commands/MigrateRepo/MigrateRepoCommandHandlerTests.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ await _handler.Invoking(async x => await x.Handle(new MigrateRepoCommandArgs
16801680
}
16811681

16821682
[Fact]
1683-
public async Task Keep_Archive_Does_Not_Call_DeleteIfExists()
1683+
public async Task Keep_Archive_Does_Not_Call_DeleteIfExists_And_Logs_Downloaded_Archive_Paths()
16841684
{
16851685
_mockTargetGithubApi.Setup(x => x.GetOrganizationId(TARGET_ORG).Result).Returns(GITHUB_ORG_ID);
16861686
_mockTargetGithubApi.Setup(x => x.CreateGhecMigrationSource(GITHUB_ORG_ID).Result).Returns(MIGRATION_SOURCE_ID);
@@ -1737,6 +1737,9 @@ public async Task Keep_Archive_Does_Not_Call_DeleteIfExists()
17371737

17381738
_mockFileSystemProvider.Verify(x => x.DeleteIfExists(GIT_ARCHIVE_FILE_PATH), Times.Never);
17391739
_mockFileSystemProvider.Verify(x => x.DeleteIfExists(METADATA_ARCHIVE_FILE_PATH), Times.Never);
1740+
1741+
_mockOctoLogger.Verify(x => x.LogInformation($"Git archive was successfully downloaded at \"{GIT_ARCHIVE_FILE_PATH}\""));
1742+
_mockOctoLogger.Verify(x => x.LogInformation($"Metadata archive was successfully downloaded at \"{METADATA_ARCHIVE_FILE_PATH}\""));
17401743
}
17411744

17421745
[Fact]

src/gei/Commands/MigrateRepo/MigrateRepoCommand.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public MigrateRepoCommand() : base(
150150

151151
public Option<bool> KeepArchive { get; } = new("--keep-archive")
152152
{
153-
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."
153+
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."
154154
};
155155

156156
public override MigrateRepoCommandHandler BuildHandler(MigrateRepoCommandArgs args, IServiceProvider sp)

src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ private string ExtractGhesBaseUrl(string ghesApiUrl)
262262
{
263263
_log.LogInformation($"Downloading archive from {gitArchiveUrl}");
264264
await _httpDownloadService.DownloadToFile(gitArchiveUrl, gitArchiveDownloadFilePath);
265-
_log.LogInformation("Download complete");
265+
_log.LogInformation(keepArchive ? $"Git archive was successfully downloaded at \"{gitArchiveDownloadFilePath}\"" : "Download complete");
266266

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

271271
return (
272272
await UploadArchive(

0 commit comments

Comments
 (0)