From ab70207b7402938eb34fdc2036702b5545b08138 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 3 Apr 2026 11:01:39 -0400 Subject: [PATCH 1/2] fix(ci): verify choco package install after 5xx from feed --- scripts/environment/bootstrap-windows-2025.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/environment/bootstrap-windows-2025.ps1 b/scripts/environment/bootstrap-windows-2025.ps1 index 862efc554a187..6472d5da96444 100644 --- a/scripts/environment/bootstrap-windows-2025.ps1 +++ b/scripts/environment/bootstrap-windows-2025.ps1 @@ -11,7 +11,9 @@ function Install-ChocoPackage { for ($attempt = 1; $attempt -le $MaxRetries; $attempt++) { choco install $Package --execution-timeout=7200 -y - if ($LASTEXITCODE -eq 0) { + # choco can return exit code 0 even on 5xx errors from the feed, + # so verify the package is actually installed + if ($LASTEXITCODE -eq 0 -and (choco list --local-only --exact $Package | Select-String $Package)) { return } From 2219c5e08da3c8d6b5f39248ea65751cbf52908a Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 20 Apr 2026 15:27:51 -0400 Subject: [PATCH 2/2] fix(ci): match package name in choco list output to verify install --- scripts/environment/bootstrap-windows-2025.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/environment/bootstrap-windows-2025.ps1 b/scripts/environment/bootstrap-windows-2025.ps1 index 6472d5da96444..9686811a97238 100644 --- a/scripts/environment/bootstrap-windows-2025.ps1 +++ b/scripts/environment/bootstrap-windows-2025.ps1 @@ -11,9 +11,10 @@ function Install-ChocoPackage { for ($attempt = 1; $attempt -le $MaxRetries; $attempt++) { choco install $Package --execution-timeout=7200 -y - # choco can return exit code 0 even on 5xx errors from the feed, - # so verify the package is actually installed - if ($LASTEXITCODE -eq 0 -and (choco list --local-only --exact $Package | Select-String $Package)) { + # Both `choco install` and `choco list` can exit 0 even on 5xx errors + # from the feed, so verify install by matching a "name|version" line + # in the list output. --limit-output strips headers/warnings. + if ((choco list --limit-output -e $Package) -match "^$([regex]::Escape($Package))\|") { return }