Skip to content

feat(install): uninstall the shell and undo what the installer changed - #61

Merged
kanushka merged 3 commits into
feat/install-windows-issue-55from
feat/uninstall-issue-56
Aug 11, 2026
Merged

feat(install): uninstall the shell and undo what the installer changed#61
kanushka merged 3 commits into
feat/install-windows-issue-55from
feat/uninstall-issue-56

Conversation

@kanushka

Copy link
Copy Markdown
Contributor

Closes #56. Stacked on #60.

Adds scripts/uninstall.sh and scripts/uninstall.ps1, and extends the Windows CI job to drive them. Every test installs first through the real installer and then removes it, so what is asserted is that the uninstall removes what the installer wrote rather than what a test arranged to look like it.

Configuration, contexts and credentials survive by default and --purge / -Purge removes them, because removing a binary is not the same decision as abandoning a setup. Uninstalling when nothing is installed reports that and exits zero, which also makes it usable to clean up a half-finished install.

Two cases worth calling out: the Unix script checks every known profile rather than only the one the running shell would use, so a block written by a zsh install is still removed by a bash user; and the Windows script rewrites the per-user PATH keeping every unrelated entry, with a test that fails if any of them is lost.

@kanushka
kanushka requested a review from hevayo as a code owner August 10, 2026 18:32
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3cfb6789-3d9b-49b5-a039-35bc5a9256f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a cross-platform uninstall path that reverses what the installer changed (binary + PATH/profile wiring), with acceptance tests that install via the real installer and then verify uninstall correctness (including optional state purge and Windows PATH preservation).

Changes:

  • Added scripts/uninstall.sh (Unix) and scripts/uninstall.ps1 (Windows) to remove installed binaries and undo shell/PATH changes, with optional --purge / -Purge.
  • Added Unix + Windows acceptance tests that perform an install → uninstall round trip and assert correct cleanup and messaging.
  • Updated Windows CI to run both install and uninstall acceptance tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/uninstall.sh New Unix uninstall script removing installed binary, empty bin dir, and profile block; supports --purge.
scripts/uninstall.ps1 New Windows uninstall script removing installed binary, empty bin dir, user PATH entry, and user WSO2_HOME; supports -Purge.
test/acceptance/uninstall_unix_test.go New acceptance tests validating Unix uninstall behavior and edge cases (no install, manual block removal, different shell profile).
test/acceptance/uninstall_windows_test.go New acceptance tests validating Windows uninstall behavior, including preserving unrelated PATH entries.
test/acceptance/install_windows_test.go Refactor to share a common PowerShell invocation environment for install/uninstall.
.github/workflows/pr-checks.yml Runs uninstall acceptance tests in the Windows job alongside install tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/uninstall.sh
Comment thread scripts/uninstall.ps1
Comment thread scripts/uninstall.sh
@kanushka
kanushka merged commit a10f335 into feat/release-artifacts-issue-53 Aug 11, 2026
5 checks passed
@kanushka
kanushka deleted the feat/uninstall-issue-56 branch August 19, 2026 17:18
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.

2 participants