fix(scripts): remove all detected installations on uninstall#106
Merged
Conversation
make uninstall-poetry with a uv install + an apt install aborted on the first: remove_installation had no uv handler, its non-zero return killed the removal loop under set -e, and the apt handler re-resolved the binary via command -v — which with multiple installations hits whichever shadows the others in PATH, so dpkg -S missed and the apt removal no-oped. - add uv handler (uv tool uninstall) - guard the removal loop so one failed method no longer aborts the rest; leftovers still surface via the post-removal verify - pass the detected path into remove_installation; apt and manual/github_release_binary handlers prefer it over command -v - classify npm packages inside an nvm node dir (pnpm, eslint, ...) as npm(vX) instead of nvm(vX) so they are removable via npm uninstall -g; only node/npm/npx/corepack stay nvm-managed (matches the dormant assertion in tests/test_guide_multi_install.sh) - drop an unused local in can_install_via_method (pre-existing SC2034 that blocked the shellcheck hook on this change) Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
=======================================
Coverage 72.45% 72.45%
=======================================
Files 22 22
Lines 3402 3402
=======================================
Hits 2465 2465
Misses 937 937
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CybotTM
added a commit
that referenced
this pull request
Jul 17, 2026
## Summary Retro follow-ups from this week's bug chain (#106–#111): 1. **`scripts/AGENTS.md` — four hard-won invariants**, each of which caused a shipped bug: never verify installs via PATH lookup (resolve the manager's bin dir; pass detected paths into removal code), environments ≠ installations (both detection layers must stay in sync), quiet command wrappers detach stdin and surface failures, and the shellcheck hook lints the whole changed file. 2. **CI `Shell Tests` job** running `tests/test_guide_multi_install.sh` (52 assertions) and `tests/test_reconcile_dryrun.sh` (7 assertions) — they were wired into no job, and a dormant assertion in the former (`classify nvm path returns npm(...)`) predicted the pnpm/nvm misclassification fixed in #106 long before it bit. Both suites verified green locally before wiring. Came from /retro: yes
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.



Summary
Fixes three uninstall bugs found in a real
make uninstall-poetry/make uninstall-pnpmsession (poetry installed via both uv and apt; pnpm as an npm global inside nvm's node):uvremoval handler —remove_installationfell through toUnsupported removal method: uvand its non-zero return aborted the whole removal loop underset -e, so the apt installation was never attempted. Added auv tool uninstallhandler and guarded the loop (|| true) — leftovers still surface via the post-removal verify.nvm(vX)and were blanket-skipped. They now classify asnpm(vX)and are removed vianpm uninstall -g; onlynode/npm/npx/corepackstay nvm-managed. This matches the previously dormant assertion intests/test_guide_multi_install.sh(classify nvm path returns npm(...)).command -v, which hits whichever installation shadows the others in PATH;dpkg -Sthen missed and the apt removal silently no-oped. The detected path is now passed down and preferred.Also drops an unused
local configincan_install_via_method— a pre-existing SC2034 that blocked the shellcheck pre-commit hook on any change tocapability.sh.Tests
tests/test_uninstall_fixes.py(11 tests, TDD red→green): uv handler invocation, failing-uv resilience, nvm-vs-npm classification for bothclassify_install_pathanddetect_install_method, loop resilience, apt/manual path precision with dpkg/sudo/apt-get PATH stubstests/test_guide_multi_install.sh: 52 passed, 0 failed; shellcheck clean on the three touched scripts; smoke tests pass