refactor(uninstall): extract plan domain helpers#3080
Conversation
This reverts commit 4ebeae4.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR introduces a new uninstall system comprising domain models for shim classification and path resolution, plan construction logic that orchestrates cleanup operations, and an actions layer that builds host-side uninstall plans from environment variables. Five new modules with supporting tests are added. ChangesUninstall Feature System
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
Automated PR review summaryReviewed PR #3080: refactor(uninstall): extract plan domain helpers Recommendation
Installation and setup findings
What was validated
Failing tests and unresolved impact
Passing tests and why they matteredPassing test 1: Shim classification is strict enough to avoid deleting user-managed wrapper-like files
Passing test 2: Host uninstall plan derives cleanup targets from env while preserving a foreign shim
Passing test 3: Toggle handling matches claimed uninstall planning behavior
Passing test 4: Runtime uninstall entrypoint remains uninstall.sh
Bottom line
|
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
prekshivyas
left a comment
There was a problem hiding this comment.
Clean additive refactor — 528+/0-, 8 new files under src/lib/domain/uninstall/ and src/lib/actions/.
- Models the six steps of
uninstall.shas typed plan actions (delete-openshell-provider,destroy-openshell-gateway,delete-shim,preserve-shim,delete-docker-volume,(delete|preserve)-ollama-models,(delete|preserve)-openshell-binary,delete-runtime-glob,delete-path,uninstall-npm-package,stop-*). - No call-site rewiring this PR —
uninstall.shremains the entrypoint, helpers have zero callers (deliberate prep for next stacked PR). - Unit coverage looks thorough:
paths.test.ts(XDG/TMPDIR derivation),plan.test.ts(full structure + delete-models / keep-openshell / custom gateway / foreign-shim variants),shims.test.ts(symlink / managed wrapper / dev-shim / foreign / missing / unsupported),uninstall-plan.test.ts(real-fs classification path). - Public CLI surface unchanged. No drive-by edits, no new orphan imports in
src/nemoclaw.ts.
Nit (non-blocking): isInstallerManagedWrapperContents and isDevShimContents rely on exact line-count plus prefix/suffix matching of the wrapper content. Slightly brittle if the installer ever changes the wrapper format, but the fallthrough goes to preserve-foreign-file (no unsafe deletes), and the marker-based dev-shim check is robust.
CI: pr.yaml rollup checks pass (commit-lint, dco, layer-boundary, check-hash, CodeRabbit). Self-hosted: prior completed run was success on pull-request/3080; build-sandbox-images / macos-e2e / current self-hosted run still in progress at approval time.
Summary
Extracts uninstaller decision logic into typed domain/action helpers without changing the shell uninstaller entrypoint. This creates the testable planning layer needed before replacing
uninstall.shwith an internal oclif command wrapper in the next stacked PR.Changes
Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com
Summary by CodeRabbit
New Features
Tests