Skip to content

Fix Windows PowerShell --help/version checks in Windows CLI integration workflow#38115

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-help-windows
Jun 9, 2026
Merged

Fix Windows PowerShell --help/version checks in Windows CLI integration workflow#38115
pelikhan merged 2 commits into
mainfrom
copilot/fix-help-windows

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The Windows integration job was failing in the legacy powershell step even when gh-aw.exe --help printed successfully. The failure came from unreliable exit-code handling in that execution path, which caused false negatives and skipped downstream checks.

  • Root cause

    • Start-Process ... -PassThru -NoNewWindow in shell: powershell occasionally produced an empty/invalid ExitCode in CI for short-lived commands.
  • Workflow execution change (legacy PowerShell only)

    • Replaced Start-Process usage in the two shell: powershell steps (--help, version) with System.Diagnostics.ProcessStartInfo + [System.Diagnostics.Process]::Start(...).
    • Kept explicit 30s timeout behavior (WaitForExit(30000) + kill on timeout).
    • Kept strict non-zero exit handling.
  • Scope

    • Only .github/workflows/windows-cli-integration.yml was updated.
    • pwsh and cmd checks remain unchanged.
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = $env:BINARY
$psi.Arguments = "--help"
$psi.UseShellExecute = $false
$proc = [System.Diagnostics.Process]::Start($psi)
if (-Not $proc.WaitForExit(30000)) { $proc.Kill(); throw "TIMEOUT: --help hung for 30s in Windows PowerShell" }
if ($proc.ExitCode -ne 0) { throw "Exit code $($proc.ExitCode)" }

Copilot AI and others added 2 commits June 9, 2026 12:48
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Fix Windows PowerShell --help check in Windows CLI integration Fix Windows PowerShell --help/version checks in Windows CLI integration workflow Jun 9, 2026
Copilot AI requested a review from pelikhan June 9, 2026 12:56
@pelikhan pelikhan marked this pull request as ready for review June 9, 2026 13:04
Copilot AI review requested due to automatic review settings June 9, 2026 13:04
@pelikhan pelikhan merged commit 1c7098b into main Jun 9, 2026
@pelikhan pelikhan deleted the copilot/fix-help-windows branch June 9, 2026 13:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows CLI integration workflow to make the legacy powershell (powershell.exe / PS 5.x) --help and version checks more reliable by avoiding Start-Process exit-code flakiness in CI.

Changes:

  • Replaced Start-Process -PassThru -NoNewWindow with System.Diagnostics.ProcessStartInfo + [System.Diagnostics.Process]::Start(...) for the legacy powershell --help step.
  • Replaced Start-Process -PassThru -NoNewWindow with System.Diagnostics.ProcessStartInfo + [System.Diagnostics.Process]::Start(...) for the legacy powershell version step.
  • Kept the existing WaitForExit(30000) timeout + kill-on-timeout + non-zero-exit enforcement behavior.
Show a summary per file
File Description
.github/workflows/windows-cli-integration.yml Updates legacy Windows PowerShell process launching for --help/version to reduce CI false negatives from unreliable exit-code handling.

Copilot's findings

Tip

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

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment on lines +126 to +130
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = $env:BINARY
$psi.Arguments = "--help"
$psi.UseShellExecute = $false
$proc = [System.Diagnostics.Process]::Start($psi)
Comment on lines +141 to +145
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = $env:BINARY
$psi.Arguments = "version"
$psi.UseShellExecute = $false
$proc = [System.Diagnostics.Process]::Start($psi)
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