Skip to content

[release/0.23] Add new powershell script for test-ci to remove need for choco install on build agents#117

Merged
danegsta merged 2 commits intorelease/0.23from
backport/pr-115-to-release/0.23
Apr 23, 2026
Merged

[release/0.23] Add new powershell script for test-ci to remove need for choco install on build agents#117
danegsta merged 2 commits intorelease/0.23from
backport/pr-115-to-release/0.23

Conversation

@danegsta
Copy link
Copy Markdown
Member

Backport of #115 to release/0.23

/cc @danegsta

Customer Impact

Testing

Risk

Regression?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Windows-specific CI test driver script to run the equivalent of make test-ci without requiring GNU make/mingw, and updates CI pipelines to use it on Windows (backport of #115 to release/0.23).

Changes:

  • Introduces scripts/test-ci.ps1 to build test prerequisites (including grpc codegen) and run go test on Windows without GNU make/choco dependencies.
  • Updates GitHub Actions workflow to run the new PowerShell test script on Windows.
  • Updates Azure Pipelines to remove Chocolatey installation of make/mingw and run the new script for Windows tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/test-ci.ps1 New Windows CI test driver: installs protoc, runs grpc codegen, builds test prereqs, and runs go test.
Makefile Adds notes documenting that Windows CI uses scripts/test-ci.ps1 and must stay in sync with test-ci targets.
.github/workflows/build-test.yml Switches Windows job to run pwsh ./scripts/test-ci.ps1 instead of make test-ci and removes choco prereqs install.
.azure/pipelines/common-build.yml Removes Windows choco install step and runs ./scripts/test-ci.ps1 for Windows test stage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/test-ci.ps1
$url = "https://github.com/protocolbuffers/protobuf/releases/download/v$ProtocVersion/$zipName"

Write-Host "Downloading $url"
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invoke-WebRequest is called with -UseBasicParsing, which is not supported in PowerShell 6+ (pwsh). Since the GitHub Actions workflow runs this script via pwsh, this will fail at runtime. Drop -UseBasicParsing (or switch to curl.exe like the Makefile) so the download works under PowerShell 7+.

Suggested change
Invoke-WebRequest -Uri $url -OutFile $zipPath -UseBasicParsing
Invoke-WebRequest -Uri $url -OutFile $zipPath

Copilot uses AI. Check for mistakes.
Comment thread scripts/test-ci.ps1
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue' # Makes Invoke-WebRequest / Expand-Archive noticeably faster.

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script assumes the Windows CI job runs with CGO_ENABLED=0 (to avoid needing a C toolchain), but it never sets CGO_ENABLED for the go build / go test invocations, and the updated CI workflows don’t export it either. Set $env:CGO_ENABLED = '0' (ideally once near the top, or within Invoke-Native/Invoke-GoBuild) to ensure the script actually removes the mingw/gcc dependency and stays consistent with the Makefile’s default.

Suggested change
# Match the Makefile's Windows CI default so Go commands do not require a C toolchain.
$env:CGO_ENABLED = '0'

Copilot uses AI. Check for mistakes.
@danegsta danegsta merged commit 2d193a6 into release/0.23 Apr 23, 2026
15 checks passed
@danegsta danegsta deleted the backport/pr-115-to-release/0.23 branch April 23, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants