feat(install): install the shell on Windows with one command - #60
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a first-class Windows “one-command” installer (scripts/install.ps1) and validates it in CI with a Windows acceptance job, aligning Windows behavior with the existing Unix installer contract and test scenarios.
Changes:
- Added a PowerShell installer that downloads the correct release for the detected Windows architecture, verifies SHA-256 checksums, installs into the WSO2 state root, and updates the per-user
Path. - Added Windows acceptance tests that exercise the installer against the shared fixture release (including idempotence and verification failures) while restoring per-user environment variables afterwards.
- Refactored installer acceptance fixtures into a shared file so Unix and Windows runs are proven against the same artifact/tag/checksum contract.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/install.ps1 |
New Windows installer implementation (download, verify, extract, install, and PATH wiring). |
test/acceptance/install_windows_test.go |
Windows-only acceptance coverage for the installer, including user-environment assertions and cleanup. |
test/acceptance/install_unix_test.go |
Adjusted Unix acceptance harness to use shared fixture infrastructure and platform-specific fields. |
test/acceptance/install_fixture_test.go |
New shared fixture release server + archive builder used by both Unix and Windows installer tests. |
.github/workflows/pr-checks.yml |
Added a windows-latest job to run the installer acceptance tests on a real Windows runner. |
Suppressed comments (2)
scripts/install.ps1:131
-UseBasicParsingis not available in PowerShell 6+/7+, and the test harness preferspwshwhen present. This makes latest-version resolution fail on runners with PowerShell 7. Use a version-conditional splat so Windows PowerShell 5.1 can still request basic parsing.
$url = "$(Get-ReleaseBaseUrl)/latest"
try {
$response = Invoke-WebRequest -Uri $url -UseBasicParsing
} catch {
Stop-WithError "could not reach $url to find the newest release: $($_.Exception.Message)"
scripts/install.ps1:269
-UseBasicParsingis not available in PowerShell 6+/7+, so the checksum download will fail underpwsh. Use a version-conditional splat to keep compatibility with Windows PowerShell 5.1 without breaking PowerShell 7.
try {
Invoke-WebRequest -Uri "$(Get-ReleaseBaseUrl)/download/$tag/checksums.txt" `
-OutFile $checksumPath -UseBasicParsing
} catch {
Stop-WithError "could not download the checksum file for $tag, so the archive cannot be verified."
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ssue-55 # Conflicts: # test/acceptance/install_unix_test.go
Closes #55. Stacked on #59.
Adds
scripts/install.ps1and awindows-latestCI job that drives it through the same scenarios the Unix runs cover. The fixture release moved into a shared file so both scripts are proven against one contract rather than two descriptions of it, and the archives now carry the real shell built with the version the tag names, so a test installs and then runs what it installed.Two deliberate departures from the Choreo installer this design came from: architecture detection handles arm64 rather than only 64-bit versus 32-bit, and the
mklinksymlink step is gone — it raised a UAC prompt and passed too few arguments to create a working link. Nothing here needs administrator rights.I could not run PowerShell locally, so unlike #58 and #59 this script is unverified except by cross-compiled
go vet. The Windows CI job on this PR is the first real execution; I will watch it and fix what it finds.