Skip to content

Commit 9ed3715

Browse files
Arin Ghazariantimrogers
andauthored
Continue executing the script if queuing repo migrations fails (#842)
Closes #840 Fixes #781 - [x] Did you write/update appropriate tests - [x] Release notes updated (if appropriate) - [x] Appropriate logging output - [x] Issue linked - [x] Docs updated (or issue created) - [x] New package licenses are added to `ThirdPartyNotices.txt` (if applicable) ### Description This PR makes a generated script by `ado2gh` and `gei` for parallel migrations more resilient by not halting the entire script execution if a repo migration fails in the queueing phase. This change only applies to scripts generated to perform migrations in parallel. Also I tired to keep the changes as minimal and simple as possible since one of our main goals is to keep the script easy to understand and modify by users. ### Before/After Script Samples <details><summary>ADO2GH Before</summary> <p> ```powershell #!/usr/bin/env pwsh # =========== Created with CLI version 1.0.0.0 =========== function Exec { param ( [scriptblock]$ScriptBlock ) & @ScriptBlock if ($lastexitcode -ne 0) { exit $lastexitcode } } function ExecAndGetMigrationID { param ( [scriptblock]$ScriptBlock ) $MigrationID = Exec $ScriptBlock | ForEach-Object { Write-Host $_ $_ } | Select-String -Pattern "\(ID: (.+)\)" | ForEach-Object { $_.matches.groups[1] } return $MigrationID } function ExecBatch { param ( [scriptblock[]]$ScriptBlocks ) $Global:LastBatchFailures = 0 foreach ($ScriptBlock in $ScriptBlocks) { & @ScriptBlock if ($lastexitcode -ne 0) { $Global:LastBatchFailures++ } } } $Succeeded = 0 $Failed = 0 $RepoMigrations = [ordered]@{} # =========== Queueing migration for Organization: adoorg =========== # === Queueing repo migrations for Team Project: adoorg/BarProject === $MigrationID = ExecAndGetMigrationID { gh ado2gh migrate-repo --ado-org "adoorg" --ado-team-project "BarProject" --ado-repo "BarProject" --github-org "GitHubOrg" --github-repo "BarProject-BarProject" } $RepoMigrations["adoorg/BarProject-BarProject"] = $MigrationID $MigrationID = ExecAndGetMigrationID { gh ado2gh migrate-repo --ado-org "adoorg" --ado-team-project "BarProject" --ado-repo "DragonRepo" --github-org "GitHubOrg" --github-repo "BarProject-DragonRepo" } $RepoMigrations["adoorg/BarProject-DragonRepo"] = $MigrationID # =========== Waiting for all migrations to finish for Organization: adoorg =========== # === Waiting for repo migration to finish for Team Project: BarProject and Repo: BarProject. Will then complete the below post migration steps. === $CanExecuteBatch = $true if ($null -ne $RepoMigrations["adoorg/BarProject-BarProject"]) { gh ado2gh wait-for-migration --migration-id $RepoMigrations["adoorg/BarProject-BarProject"] $CanExecuteBatch = ($lastexitcode -eq 0) } if ($CanExecuteBatch) { $Succeeded++ } else { $Failed++ } # === Waiting for repo migration to finish for Team Project: BarProject and Repo: DragonRepo. Will then complete the below post migration steps. === $CanExecuteBatch = $true if ($null -ne $RepoMigrations["adoorg/BarProject-DragonRepo"]) { gh ado2gh wait-for-migration --migration-id $RepoMigrations["adoorg/BarProject-DragonRepo"] $CanExecuteBatch = ($lastexitcode -eq 0) } if ($CanExecuteBatch) { $Succeeded++ } else { $Failed++ } Write-Host =============== Summary =============== Write-Host Total number of successful migrations: $Succeeded Write-Host Total number of failed migrations: $Failed if ($Failed -ne 0) { exit 1 } ``` </p> </details> <details><summary>ADO2GH After</summary> <p> ```powershell #!/usr/bin/env pwsh # =========== Created with CLI version 1.0.0.0 =========== function Exec { param ( [scriptblock]$ScriptBlock ) & @ScriptBlock if ($lastexitcode -ne 0) { exit $lastexitcode } } function ExecAndGetMigrationID { param ( [scriptblock]$ScriptBlock ) $MigrationID = & @ScriptBlock | ForEach-Object { Write-Host $_ $_ } | Select-String -Pattern "\(ID: (.+)\)" | ForEach-Object { $_.matches.groups[1] } return $MigrationID } function ExecBatch { param ( [scriptblock[]]$ScriptBlocks ) $Global:LastBatchFailures = 0 foreach ($ScriptBlock in $ScriptBlocks) { & @ScriptBlock if ($lastexitcode -ne 0) { $Global:LastBatchFailures++ } } } $Succeeded = 0 $Failed = 0 $RepoMigrations = [ordered]@{} # =========== Queueing migration for Organization: adoorg =========== # === Queueing repo migrations for Team Project: adoorg/BarProject === $MigrationID = ExecAndGetMigrationID { gh ado2gh migrate-repo --ado-org "adoorg" --ado-team-project "BarProject" --ado-repo "BarProject" --github-org "GitHubOrg" --github-repo "BarProject-BarProject" } $RepoMigrations["adoorg/BarProject-BarProject"] = $MigrationID $MigrationID = ExecAndGetMigrationID { gh ado2gh migrate-repo --ado-org "adoorg" --ado-team-project "BarProject" --ado-repo "DragonRepo" --github-org "GitHubOrg" --github-repo "BarProject-DragonRepo" } $RepoMigrations["adoorg/BarProject-DragonRepo"] = $MigrationID # =========== Waiting for all migrations to finish for Organization: adoorg =========== # === Waiting for repo migration to finish for Team Project: BarProject and Repo: BarProject. Will then complete the below post migration steps. === $CanExecuteBatch = $false if ($null -ne $RepoMigrations["adoorg/BarProject-BarProject"]) { gh ado2gh wait-for-migration --migration-id $RepoMigrations["adoorg/BarProject-BarProject"] $CanExecuteBatch = ($lastexitcode -eq 0) } if ($CanExecuteBatch) { $Succeeded++ } else { $Failed++ } # === Waiting for repo migration to finish for Team Project: BarProject and Repo: DragonRepo. Will then complete the below post migration steps. === $CanExecuteBatch = $false if ($null -ne $RepoMigrations["adoorg/BarProject-DragonRepo"]) { gh ado2gh wait-for-migration --migration-id $RepoMigrations["adoorg/BarProject-DragonRepo"] $CanExecuteBatch = ($lastexitcode -eq 0) } if ($CanExecuteBatch) { $Succeeded++ } else { $Failed++ } Write-Host =============== Summary =============== Write-Host Total number of successful migrations: $Succeeded Write-Host Total number of failed migrations: $Failed if ($Failed -ne 0) { exit 1 } ``` </p> </details> ---- <details><summary>GEI Before</summary> <p> ```powershell #!/usr/bin/env pwsh # =========== Created with CLI version 1.0.0.0 =========== function Exec { param ( [scriptblock]$ScriptBlock ) & @ScriptBlock if ($lastexitcode -ne 0) { exit $lastexitcode } } function ExecAndGetMigrationID { param ( [scriptblock]$ScriptBlock ) $MigrationID = Exec $ScriptBlock | ForEach-Object { Write-Host $_ $_ } | Select-String -Pattern "\(ID: (.+)\)" | ForEach-Object { $_.matches.groups[1] } return $MigrationID } $Succeeded = 0 $Failed = 0 $RepoMigrations = [ordered]@{} # =========== Organization: github-source-org =========== # === Queuing repo migrations === $MigrationID = ExecAndGetMigrationID { gh gei migrate-repo --github-source-org "github-source-org" --source-repo "repo-1" --github-target-org "github-target-org" --target-repo "repo-1" --ghes-api-url "https://myghes.com/api/v3" } $RepoMigrations["repo-1"] = $MigrationID $MigrationID = ExecAndGetMigrationID { gh gei migrate-repo --github-source-org "github-source-org" --source-repo "repo-2" --github-target-org "github-target-org" --target-repo "repo-2" --ghes-api-url "https://myghes.com/api/v3" } $RepoMigrations["repo-2"] = $MigrationID # =========== Waiting for all migrations to finish for Organization: github-source-org =========== gh gei wait-for-migration --migration-id $RepoMigrations["repo-1"] if ($lastexitcode -eq 0) { $Succeeded++ } else { $Failed++ } gh gei wait-for-migration --migration-id $RepoMigrations["repo-2"] if ($lastexitcode -eq 0) { $Succeeded++ } else { $Failed++ } Write-Host =============== Summary =============== Write-Host Total number of successful migrations: $Succeeded Write-Host Total number of failed migrations: $Failed if ($Failed -ne 0) { exit 1 } ``` </p> </details> <details><summary>GEI After</summary> <p> #### yes, even hidden code blocks! ```powershell #!/usr/bin/env pwsh # =========== Created with CLI version 1.0.0.0 =========== function ExecAndGetMigrationID { param ( [scriptblock]$ScriptBlock ) $MigrationID = & @ScriptBlock | ForEach-Object { Write-Host $_ $_ } | Select-String -Pattern "\(ID: (.+)\)" | ForEach-Object { $_.matches.groups[1] } return $MigrationID } $Succeeded = 0 $Failed = 0 $RepoMigrations = [ordered]@{} # =========== Organization: github-source-org =========== # === Queuing repo migrations === $MigrationID = ExecAndGetMigrationID { gh gei migrate-repo --github-source-org "github-source-org" --source-repo "repo-1" --github-target-org "github-target-org" --target-repo "repo-1" --ghes-api-url "https://myghes.com/api/v3" } $RepoMigrations["repo-1"] = $MigrationID $MigrationID = ExecAndGetMigrationID { gh gei migrate-repo --github-source-org "github-source-org" --source-repo "repo-2" --github-target-org "github-target-org" --target-repo "repo-2" --ghes-api-url "https://myghes.com/api/v3" } $RepoMigrations["repo-2"] = $MigrationID # =========== Waiting for all migrations to finish for Organization: github-source-org =========== if ($RepoMigrations["repo-1"]) { gh gei wait-for-migration --migration-id $RepoMigrations["repo-1"] } if ($RepoMigrations["repo-1"] -and $lastexitcode -eq 0) { $Succeeded++ } else { $Failed++ } if ($RepoMigrations["repo-2"]) { gh gei wait-for-migration --migration-id $RepoMigrations["repo-2"] } if ($RepoMigrations["repo-2"] -and $lastexitcode -eq 0) { $Succeeded++ } else { $Failed++ } Write-Host =============== Summary =============== Write-Host Total number of successful migrations: $Succeeded Write-Host Total number of failed migrations: $Failed if ($Failed -ne 0) { exit 1 } ``` </p> </details> --------- Co-authored-by: Tim Rogers <[email protected]>
1 parent 5d9ddd5 commit 9ed3715

File tree

5 files changed

+58
-129
lines changed

5 files changed

+58
-129
lines changed

RELEASENOTES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
- Create shared access signature (SAS) with read-only permissions - not read-write - when generating Azure Blob Storage URL
22
- Fixes bug where CLI would crash if the source was GHAE (while trying to parse the version)
3-
- Add support for authenticating with AWS session tokens when using AWS S3 for archive upload in `gh gei` and `gh bbs2gh`. When specifying a session token, the AWS region must also be specified.
3+
- Add support for authenticating with AWS session tokens when using AWS S3 for archive upload in `gh gei` and `gh bbs2gh`. When specifying a session token, the AWS region must also be specified.
4+
- Make parallel migrations scripts generated by `gh gei generate-script` and `gh ado2gh generate-script` more resilient by not halting the entire script if queuing a repo migration fails.

src/OctoshiftCLI.Tests/ado2gh/Handlers/GenerateScriptCommandHandlerTests.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ function ExecAndGetMigrationID {
596596
param (
597597
[scriptblock]$ScriptBlock
598598
)
599-
$MigrationID = Exec $ScriptBlock | ForEach-Object {
599+
$MigrationID = & @ScriptBlock | ForEach-Object {
600600
Write-Host $_
601601
$_
602602
} | Select-String -Pattern ""\(ID: (.+)\)"" | ForEach-Object { $_.matches.groups[1] }
@@ -631,7 +631,7 @@ function ExecBatch {
631631
expected.AppendLine($"# =========== Waiting for all migrations to finish for Organization: {ADO_ORG} ===========");
632632
expected.AppendLine();
633633
expected.AppendLine($"# === Waiting for repo migration to finish for Team Project: {ADO_TEAM_PROJECT} and Repo: {FOO_REPO}. Will then complete the below post migration steps. ===");
634-
expected.AppendLine("$CanExecuteBatch = $true");
634+
expected.AppendLine("$CanExecuteBatch = $false");
635635
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
636636
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
637637
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -693,7 +693,7 @@ function ExecAndGetMigrationID {
693693
param (
694694
[scriptblock]$ScriptBlock
695695
)
696-
$MigrationID = Exec $ScriptBlock | ForEach-Object {
696+
$MigrationID = & @ScriptBlock | ForEach-Object {
697697
Write-Host $_
698698
$_
699699
} | Select-String -Pattern ""\(ID: (.+)\)"" | ForEach-Object { $_.matches.groups[1] }
@@ -728,7 +728,7 @@ function ExecBatch {
728728
expected.AppendLine($"# =========== Waiting for all migrations to finish for Organization: {ADO_ORG} ===========");
729729
expected.AppendLine();
730730
expected.AppendLine($"# === Waiting for repo migration to finish for Team Project: {ADO_TEAM_PROJECT} and Repo: {FOO_REPO}. Will then complete the below post migration steps. ===");
731-
expected.AppendLine("$CanExecuteBatch = $true");
731+
expected.AppendLine("$CanExecuteBatch = $false");
732732
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
733733
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
734734
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -821,7 +821,7 @@ function ExecAndGetMigrationID {
821821
param (
822822
[scriptblock]$ScriptBlock
823823
)
824-
$MigrationID = Exec $ScriptBlock | ForEach-Object {
824+
$MigrationID = & @ScriptBlock | ForEach-Object {
825825
Write-Host $_
826826
$_
827827
} | Select-String -Pattern ""\(ID: (.+)\)"" | ForEach-Object { $_.matches.groups[1] }
@@ -864,7 +864,7 @@ function ExecBatch {
864864
expected.AppendLine($"# =========== Waiting for all migrations to finish for Organization: {ADO_ORG} ===========");
865865
expected.AppendLine();
866866
expected.AppendLine($"# === Waiting for repo migration to finish for Team Project: {ADO_TEAM_PROJECT} and Repo: {FOO_REPO}. Will then complete the below post migration steps. ===");
867-
expected.AppendLine("$CanExecuteBatch = $true");
867+
expected.AppendLine("$CanExecuteBatch = $false");
868868
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
869869
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
870870
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -885,7 +885,7 @@ function ExecBatch {
885885
expected.AppendLine("}");
886886
expected.AppendLine();
887887
expected.AppendLine($"# === Waiting for repo migration to finish for Team Project: {ADO_TEAM_PROJECT} and Repo: {BAR_REPO}. Will then complete the below post migration steps. ===");
888-
expected.AppendLine("$CanExecuteBatch = $true");
888+
expected.AppendLine("$CanExecuteBatch = $false");
889889
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{BAR_REPO}\"]) {{");
890890
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{BAR_REPO}\"]");
891891
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -962,7 +962,7 @@ function ExecAndGetMigrationID {
962962
param (
963963
[scriptblock]$ScriptBlock
964964
)
965-
$MigrationID = Exec $ScriptBlock | ForEach-Object {
965+
$MigrationID = & @ScriptBlock | ForEach-Object {
966966
Write-Host $_
967967
$_
968968
} | Select-String -Pattern ""\(ID: (.+)\)"" | ForEach-Object { $_.matches.groups[1] }
@@ -1002,7 +1002,7 @@ function ExecBatch {
10021002
expected.AppendLine($"# =========== Waiting for all migrations to finish for Organization: {ADO_ORG} ===========");
10031003
expected.AppendLine();
10041004
expected.AppendLine($"# === Waiting for repo migration to finish for Team Project: {ADO_TEAM_PROJECT} and Repo: {FOO_REPO}. Will then complete the below post migration steps. ===");
1005-
expected.AppendLine("$CanExecuteBatch = $true");
1005+
expected.AppendLine("$CanExecuteBatch = $false");
10061006
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
10071007
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
10081008
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1059,7 +1059,7 @@ public async Task ParallelScript_Create_Teams_Option_Should_Generate_Create_Team
10591059
expected.AppendLine($"Exec {{ gh ado2gh create-team --github-org \"{GITHUB_ORG}\" --team-name \"{ADO_TEAM_PROJECT}-Admins\" }}");
10601060
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
10611061
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1062-
expected.AppendLine("$CanExecuteBatch = $true");
1062+
expected.AppendLine("$CanExecuteBatch = $false");
10631063
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
10641064
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
10651065
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1104,7 +1104,7 @@ public async Task ParallelScript_Link_Idp_Groups_Option_Should_Generate_Create_T
11041104
expected.AppendLine($"Exec {{ gh ado2gh create-team --github-org \"{GITHUB_ORG}\" --team-name \"{ADO_TEAM_PROJECT}-Admins\" --idp-group \"{ADO_TEAM_PROJECT}-Admins\" }}");
11051105
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
11061106
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1107-
expected.AppendLine("$CanExecuteBatch = $true");
1107+
expected.AppendLine("$CanExecuteBatch = $false");
11081108
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
11091109
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
11101110
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1148,7 +1148,7 @@ public async Task ParallelScript_Lock_Ado_Repo_Option_Should_Generate_Lock_Ado_R
11481148
expected.AppendLine($"Exec {{ gh ado2gh lock-ado-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" }}");
11491149
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
11501150
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1151-
expected.AppendLine("$CanExecuteBatch = $true");
1151+
expected.AppendLine("$CanExecuteBatch = $false");
11521152
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
11531153
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
11541154
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1187,7 +1187,7 @@ public async Task ParallelScript_Disable_Ado_Repo_Option_Should_Generate_Disable
11871187
var expected = new StringBuilder();
11881188
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
11891189
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1190-
expected.AppendLine("$CanExecuteBatch = $true");
1190+
expected.AppendLine("$CanExecuteBatch = $false");
11911191
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
11921192
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
11931193
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1229,7 +1229,7 @@ public async Task ParallelScript_Integrate_Boards_Option_Should_Generate_Auto_Li
12291229
var expected = new StringBuilder();
12301230
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
12311231
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1232-
expected.AppendLine("$CanExecuteBatch = $true");
1232+
expected.AppendLine("$CanExecuteBatch = $false");
12331233
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
12341234
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
12351235
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");
@@ -1277,7 +1277,7 @@ public async Task ParallelScript_Rewire_Pipelines_Option_Should_Generate_Share_S
12771277
expected.AppendLine($"Exec {{ gh ado2gh share-service-connection --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --service-connection-id \"{APP_ID}\" }}");
12781278
expected.AppendLine($"$MigrationID = ExecAndGetMigrationID {{ gh ado2gh migrate-repo --ado-org \"{ADO_ORG}\" --ado-team-project \"{ADO_TEAM_PROJECT}\" --ado-repo \"{FOO_REPO}\" --github-org \"{GITHUB_ORG}\" --github-repo \"{ADO_TEAM_PROJECT}-{FOO_REPO}\" }}");
12791279
expected.AppendLine($"$RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"] = $MigrationID");
1280-
expected.AppendLine("$CanExecuteBatch = $true");
1280+
expected.AppendLine("$CanExecuteBatch = $false");
12811281
expected.AppendLine($"if ($null -ne $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]) {{");
12821282
expected.AppendLine($" gh ado2gh wait-for-migration --migration-id $RepoMigrations[\"{ADO_ORG}/{ADO_TEAM_PROJECT}-{FOO_REPO}\"]");
12831283
expected.AppendLine(" $CanExecuteBatch = ($lastexitcode -eq 0)");

0 commit comments

Comments
 (0)