feat(windows): smoke-test script + setup docs (Phase 1)#761
feat(windows): smoke-test script + setup docs (Phase 1)#761kokevidaurre wants to merge 1 commit intomainfrom
Conversation
Phase 1 of cross-platform support: validate squads-cli works on Windows. - scripts/windows-smoke-test.ps1: PowerShell parity for e2e-smoke.sh. Installs (from npm or local tarball), runs init/status/doctor/run --dry-run. Catches Windows-specific path, encoding, and PATH issues that Linux CI misses. (Force-added — scripts/ is gitignored, matching e2e-smoke.sh precedent.) - docs/windows.md: install paths (native PowerShell vs WSL2), OpenSSH setup for remote testing, common troubleshooting (long paths, ExecutionPolicy, npm prefix), Tier 2 status note. Phase 2 (separate epic): publish Bridge + API as public Docker images so Tier 2 (Postgres, Redis, API, Bridge) works for fresh users without cloning the source tree. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds Windows setup documentation and a PowerShell smoke test script to ensure cross-platform compatibility. The documentation covers native PowerShell, WSL2, and SSH configurations. Feedback on the smoke test script highlights a destructive global uninstallation in the cleanup phase, a logic error in help output verification using PowerShell operators, and a potential crash when parsing command output if no squads are found.
| function Cleanup { | ||
| Write-Host "" | ||
| Write-Host "▶ Cleaning up..." -ForegroundColor DarkGray | ||
| npm uninstall -g squads-cli 2>$null |
There was a problem hiding this comment.
This script uninstalls squads-cli globally during the cleanup phase. This is a destructive side effect for users running the smoke test on their local machines, as it will remove any existing installation of the tool. Consider using a temporary local installation path (via npm install --prefix) or providing a warning to the user.
| if ($help -notmatch 'Changelog') { | ||
| Write-Host " WARN: Resources footer missing from --help output" -ForegroundColor Yellow | ||
| } |
There was a problem hiding this comment.
The -notmatch operator, when applied to an array (the output of squads --help), returns all elements that do not match the pattern. In a boolean context, this will evaluate to true if there are any non-matching lines, which is almost always the case for CLI help output. To correctly detect the absence of the 'Changelog' string, you should check if the -match operator returns no results.
if (-not ($help -match 'Changelog')) {
Write-Host " WARN: Resources footer missing from --help output" -ForegroundColor Yellow
}
|
|
||
| Step "squads run <squad> --dry-run" | ||
| $statusOutput = squads status 2>$null | ||
| $firstSquad = ($statusOutput | Select-String -Pattern '^\s+(\w+)' | Select-Object -First 1).Matches.Groups[1].Value |
There was a problem hiding this comment.
Accessing .Matches.Groups[1].Value directly on the result of Select-String will cause a terminating error if no match is found, as the result will be null. Since $ErrorActionPreference is set to Stop, the script will crash before reaching the if ($firstSquad) check.
$match = $statusOutput | Select-String -Pattern '^\s+(\w+)' | Select-Object -First 1
$firstSquad = if ($match) { $match.Matches.Groups[1].Value } else { $null }
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
Phase 1 of cross-platform support — validates squads-cli actually works on Windows. Adds a PowerShell smoke test (parity with
scripts/e2e-smoke.sh) and a setup guide covering native PowerShell, WSL2, and OpenSSH for remote testing.Closes #747 (Windows test for v0.3.x).
What's in the PR
scripts/windows-smoke-test.ps1— runs install → init → status → doctor → run --dry-run. Supports-FromTarball(local build) and-Tag <next|latest>flags.docs/windows.md— two install paths (native vs WSL2), SSH setup commands, troubleshooting (long paths, ExecutionPolicy, PATH).What's NOT in the PR
docker-compose.ymlintemplates/— same reason; would point at images that don't exist.squads initbehaviour — Phase 1 is verification only, no scaffold changes.Why phased
Tier 2 needs work across 3 repos (
agents-squads,squads-api,squads-cli) and adds a "local mode" auth path on the API (today the API requires GCP Secret Manager). That's a multi-PR epic. Phase 1 ships independently and unlocks public announcement of v0.3.1 cross-platform support.Test plan
pwsh scripts/windows-smoke-test.ps1-Tag nextto verify @next channel works end-to-end-FromTarballto validate packaging before next release