Restructure Windows CLI integration into scenario matrix with missing shell/env/path/chaos coverage#38526
Merged
Merged
Conversation
6 tasks
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve windows-cli-integration.yml for matrix coverage and test dimensions
Restructure Windows CLI integration into scenario matrix with missing shell/env/path/chaos coverage
Jun 11, 2026
pelikhan
approved these changes
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Expands the Windows CLI integration workflow to run a broader scenario matrix across shells, PATH/launch modes, and environment-variable shapes to catch Windows-specific regressions (timeouts, PATH resolution, ANSI output, unicode paths, etc.).
Changes:
- Replaces individual
Start-Processchecks with a reusableInvoke-CliProcesshelper (timeouts, env overrides, output capture). - Adds a scenario matrix spanning
pwsh,powershell, andcmdwith different PATH/env configurations. - Adds additional checks for PATHEXT resolution, tricky path shapes (spaces/parentheses/mixed slashes), unicode working directory, minimal environment, and unknown-subcommand failure behavior.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/windows-cli-integration.yml | Introduces a PowerShell-based scenario matrix and process runner helper to broaden Windows CLI integration coverage. |
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: 5
Comment on lines
+126
to
+134
| $proc = [System.Diagnostics.Process]::Start($psi) | ||
| if (-not $proc.WaitForExit($TimeoutMs)) { | ||
| try { $proc.Kill($true) } catch {} | ||
| throw "TIMEOUT: '$FilePath $($ArgumentList -join ' ')' exceeded ${TimeoutMs}ms" | ||
| } | ||
|
|
||
| $stdout = $proc.StandardOutput.ReadToEnd() | ||
| $stderr = $proc.StandardError.ReadToEnd() | ||
| $output = "$stdout`n$stderr" |
Comment on lines
+160
to
+168
| $toolcacheDir = Join-Path $env:RUNNER_TEMP "toolcache-like" | ||
| $spaceDir = Join-Path $env:RUNNER_TEMP "path with spaces" | ||
| $parenDir = Join-Path $env:RUNNER_TEMP "Program Files (x86)" | ||
| $unicodeDir = Join-Path $env:TEMP "tëst-dïr-αβγ" | ||
| foreach ($dir in @($toolcacheDir, $spaceDir, $parenDir, $unicodeDir)) { | ||
| New-Item -ItemType Directory -Force -Path $dir | Out-Null | ||
| } | ||
| if ($proc.ExitCode -ne 0) { throw "Exit code $($proc.ExitCode)" } | ||
| Add-Content $env:GITHUB_STEP_SUMMARY "✅ [pwsh] version OK" | ||
| Copy-Item -Path $binary -Destination (Join-Path $spaceDir "gh-aw.exe") -Force | ||
| Copy-Item -Path $binary -Destination (Join-Path $parenDir "gh-aw.exe") -Force |
| @{ name = "powershell-default/direct/default/default"; shell = "powershell-default"; launch = "direct"; env = "default"; path = "default" }, | ||
| @{ name = "powershell-noprofile/direct/default/default"; shell = "powershell-noprofile"; launch = "direct"; env = "default"; path = "default" }, | ||
| @{ name = "pwsh-default/path/default/workspace-first"; shell = "pwsh-default"; launch = "path"; env = "default"; path = "workspace-first" }, | ||
| @{ name = "cmd/path/default/toolcache-first"; shell = "cmd"; launch = "path"; env = "default"; path = "toolcache-first" }, |
Comment on lines
+206
to
+212
| if ($scenario.launch -eq "path") { | ||
| $whereResult = Invoke-CliProcess -FilePath "cmd" -ArgumentList @("/d", "/s", "/c", "where gh-aw") -EnvironmentOverrides $envOverrides -UnsetEnvironment $unsetVars | ||
| $firstResolved = ($whereResult.Output -split "`r?`n" | Where-Object { $_ -match "gh-aw\.exe$" } | Select-Object -First 1) | ||
| if (-not $firstResolved -or -not $firstResolved.StartsWith($workspace, [System.StringComparison]::OrdinalIgnoreCase)) { | ||
| throw "PATH resolution mismatch for '$($scenario.name)': $firstResolved" | ||
| } | ||
| } |
Comment on lines
+185
to
+192
| foreach ($scenario in $scenarioMatrix) { | ||
| $env:PATH = $originalPath | ||
| switch ($scenario.path) { | ||
| "workspace-first" { $env:PATH = "$workspace;$originalPath" } | ||
| "toolcache-first" { $env:PATH = "$toolcacheDir;$workspace;$originalPath" } | ||
| "duplicate-workspace" { $env:PATH = "$workspace;$workspace;$originalPath" } | ||
| default {} | ||
| } |
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
windows-cli-integration.ymlhad strong baseline checks but missed several required dimensions (systematic scenario modeling, no-profile shells, PATH/PATHEXT quirks, path/Unicode edge cases, env toggles, and negative behavior). This change consolidates coverage into a matrix-driven harness and fills the missing cases with explicit timeout-guarded assertions.Matrix-driven scenario model
pwsh,powershell,cmd)NO_COLOR,TERM=dumb,TERMunset,CI=true,CIunset)Shell + launch-mode coverage
-NoProfilevariants for bothpwshandpowershell.PATH/PATHEXT + command resolution
where gh-aw) behavior.gh-awinvocations from pwsh/cmd.Filesystem/path edge cases
Command surface + chaos case
help,run --help(in addition to existing help/version coverage).Hang protection consistency
WaitForExittimeouts (including cmd-path scenarios), eliminating reliance on job-level timeout for hang detection.