feat(install): install the shell on macOS and Linux with one command - #59
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 production scripts/install.sh installer for macOS/Linux (incl. WSL) and a new Unix-only acceptance test suite that exercises the installer exactly as an end user would (real script, HTTP-served fixture release assets, isolated HOME/state root).
Changes:
- Introduces
scripts/install.shthat resolves a release (stable/prerelease/pinned), downloads and verifies an archive againstchecksums.txt, installswso2into$WSO2_HOME/bin, and wires PATH via a delimited profile block (or prints manual instructions). - Adds
test/acceptance/install_unix_test.gowith an HTTP fixture release server and tests covering clean install, idempotence, checksum failures, prerelease/pinned resolution, profile opt-out, undetectable profile, unsupported arch, andWSO2_HOMEbehavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/acceptance/install_unix_test.go | Adds acceptance coverage that runs the real installer against a local fixture release server under isolated HOME/state root. |
| scripts/install.sh | Adds the end-user installer script with release resolution, checksum verification, extraction, install, and PATH/profile wiring. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes #54. Stacked on #58 — review that first; this PR's base retargets to
mainonce it merges.Adds
scripts/install.shand drives it from the acceptance suite exactly as a user does: the real script, against a fixture release served over HTTP, with the home directory and state root redirected to temporary directories. 13 tests cover clean install, idempotence, checksum refusal, pinned versions, the prerelease channel, the profile opt-out, an undetectable profile, an unsupported architecture, and the state root variable.Also verified end to end against real GoReleaser output from #53, served locally: downloaded, checksum verified, and the installed Go binary runs.
Review caught three defects worth naming, all now fixed and covered by tests: the checksum lookup matched the filename as a substring, so a
.sigline listed first would hand over the wrong digest and refuse a valid release; the INT/TERM trap cleaned up but did not exit, so Ctrl-C let the run continue and exit 0; and underpipefailthe "checksums.txt does not list this archive" refusal was dead code that aborted with a bare exit 1 instead.