Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
begonaguereca committed Nov 7, 2024
1 parent 7f1c29d commit 59e6410
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ private async Task<string> GenerateSequentialGithubScript(IEnumerable<(string Na

content.AppendLine(VALIDATE_GH_PAT);

if (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl))
if (!useGithubStorage && (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl)))
{
if (awsBucketName.HasValue() || awsRegion.HasValue())
{
content.AppendLine(VALIDATE_AWS_ACCESS_KEY_ID);
content.AppendLine(VALIDATE_AWS_SECRET_ACCESS_KEY);
}
else if (!useGithubStorage)
else
{
content.AppendLine(VALIDATE_AZURE_STORAGE_CONNECTION_STRING);
}
Expand Down Expand Up @@ -132,14 +132,14 @@ private async Task<string> GenerateParallelGithubScript(IEnumerable<(string Name
content.AppendLine(EXEC_AND_GET_MIGRATION_ID_FUNCTION_BLOCK);

content.AppendLine(VALIDATE_GH_PAT);
if (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl))
if (!useGithubStorage && (await _ghesVersionChecker.AreBlobCredentialsRequired(ghesApiUrl)))
{
if (awsBucketName.HasValue() || awsRegion.HasValue())
{
content.AppendLine(VALIDATE_AWS_ACCESS_KEY_ID);
content.AppendLine(VALIDATE_AWS_SECRET_ACCESS_KEY);
}
else if (!useGithubStorage)
else
{
content.AppendLine(VALIDATE_AZURE_STORAGE_CONNECTION_STRING);
}
Expand Down
13 changes: 11 additions & 2 deletions src/gei/Commands/MigrateRepo/MigrateRepoCommandHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ public async Task Handle(MigrateRepoCommandArgs args)

_log.LogInformation("Migrating Repo...");

var blobCredentialsRequired = await _ghesVersionChecker.AreBlobCredentialsRequired(args.GhesApiUrl);
var blobCredentialsRequired = false;

if (args.UseGithubStorage)
{
blobCredentialsRequired = true;
}
else
{
blobCredentialsRequired = await _ghesVersionChecker.AreBlobCredentialsRequired(args.GhesApiUrl);
};

if (args.GhesApiUrl.HasValue())
{
Expand Down Expand Up @@ -396,7 +405,7 @@ private void ValidateGHESOptions(MigrateRepoCommandArgs args, bool cloudCredenti

if (args.UseGithubStorage)
{
_log.LogWarning("Ignoring --use-github-storage flag because you are running GitHub Enterprise Server (GHES) 3.8.0 or later. The blob storage credentials configured in your GHES Management Console will be used instead.");
_log.LogWarning("Provding the --use-github-storage flag will supersede any credentials you have configured in your GitHub Enterprise Server (GHES) Management Console.");
}

if (args.KeepArchive)
Expand Down

0 comments on commit 59e6410

Please sign in to comment.