feat(install): suggest --all flag in incompatibility error - #112
Conversation
When a package exists but has no compatible version, the error now additionally suggests: 'To see why this package is incompatible: numan search <name> --all' This helps newcomers understand WHY a package won't install.
There was a problem hiding this comment.
Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
📝 WalkthroughWalkthroughNu mismatch remediation now distinguishes package-wide resolution failures from exact-version failures. Each path emits different ChangesNu mismatch guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. Analyzed 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 |
PR Summary by QodoSuggest
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Qodo FixerNo findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page. |
Greptile SummaryThe PR differentiates remediation guidance for package-wide resolution failures and exact-version incompatibilities.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/core/resolve.rs | Adds failure-specific Nu compatibility remediation hints and updates tests to verify the appropriate command for each resolution path. |
Reviews (4): Last reviewed commit: "Merge branch 'master' into improve-insta..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b24faeb66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use `numan search <id> --all` for resolve failures and `numan info <id>` for exact-version mismatches so suggested commands are copy-pasteable. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/core/resolve.rs`:
- Around line 810-813: Strengthen the assertion in the relevant resolve test
around the existing err check so it also verifies that the exact-version hint
`numan info test/plugin` is absent. Keep the package-wide `numan search
test/plugin --all` assertion, ensuring Resolve and ExactVersion guidance remain
mutually exclusive.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ced15b95-1441-4f04-a346-64960c31baee
📒 Files selected for processing (1)
src/core/resolve.rs
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
tonythethompson/QuickShell(manual)tonythethompson/numan(manual)tonythethompson/dependency-chain-substrate(manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: Greptile Review
- GitHub Check: Real-Nu acceptance (windows-latest)
- GitHub Check: Test (windows-latest)
- GitHub Check: Analyze (rust)
🧰 Additional context used
📓 Path-based instructions (9)
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
**/*: Use Serena's semantic, symbol-aware tools as the primary tools for reading and editing code; use built-in Read, Glob, Grep, and Edit only under the stated exceptions.
Before editing a code file, inspect its symbol overview, read the specific symbols being changed, and edit them with Serena's symbol-aware tools.
Understand the existing code before changing it and make the smallest change that satisfies the request; avoid unrelated cleanup, premature abstractions, unnecessary error handling, feature flags, and compatibility shims.
Prefer editing existing files over creating new ones, and never create Markdown or README files unless explicitly requested.
For exploratory questions, provide a 2–3 sentence recommendation with the main tradeoff and do not implement until the user agrees.
For UI or frontend changes that cannot be tested in a browser, explicitly state that browser testing was not performed rather than claiming success.
Address security issues when discovered, including injection, XSS, SQL injection, path traversal, and secret leaks.
Pause and obtain confirmation before destructive, hard-to-reverse, externally visible, or third-party-upload actions, including deleting files or branches, dropping tables, force-pushing, modifying CI/CD, posting externally, or uploading content.
When blocked, investigate the root cause instead of bypassing it with --no-verify, --force, or deletion; investigate unfamiliar files, branches, and configuration before deleting them.
Only commit when explicitly asked; do not proactively update git configuration or push changes.
Do not skip Git hooks unless explicitly asked; if a pre-commit hook fails, fix the issue, re-stage, and create a new commit rather than amending.
Stage files by name rather than using git add -A or git add ., to avoid accidentally including secrets or large binaries.
Use a HEREDOC for commit messages, and add co-author attribution only when the user explicitly requests the exact trailer.
Do not force-pus...
Files:
src/core/resolve.rs
**/*.{js,jsx,ts,tsx,py,java,go,rs,rb,php,c,cpp,h,hpp,cs,swift,kt,kts}
📄 CodeRabbit inference engine (CLAUDE.md)
Add comments only when the WHY is non-obvious; do not narrate what the code does, reference the current task, or reference the PR in comments.
Files:
src/core/resolve.rs
!**/.env,!**/credentials.json,!**/*.pem
📄 CodeRabbit inference engine (CLAUDE.md)
Do not commit files that appear to contain secrets, including .env, credentials.json, and PEM files; warn before doing so even if explicitly requested.
Files:
src/core/resolve.rs
**/*.rs
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.rs: Use the Rust 2021 edition.
Useanyhow::Resultwith.context(...)in application code; usethiserrorfor library error types that callers match on.
Useclapderive macros for CLI definitions.
Useserdewithserde_jsonortomlfor serialization.
Function parameters must use&Path, not&PathBuf.
Library code must not panic; error paths should returnanyhow::Resultwith context where appropriate.
Add or update tests for behavior changes, including relevant failure paths.
New mutating code paths must acquire the mutation lock viaacquire_mutation_lock(root)and snapshot the lockfile before writes.
Lockfile, journal, and state-file JSON writes must usewrite_json_atomic.
numan installmust write only to$NUMAN_ROOT; it must not invoke Nu or register plugins/autoloads.
Onlyactivateanddeactivatemay modify Nu integration state.
Treat the lockfile as the authoritative source of truth; derived projections such as autoload state must not be authoritative.
Install payloads under versioned, content-addressed paths and never overwrite them in place.
Never overwrite foreign autoload files; respectOWNERSHIP_MARKER.
Pass plugin paths through environment variables only; do not use runtime interpolation in Nu program strings.
**/*.rs: All CI gates must pass:cargo test,cargo clippy -- -D warnings, andcargo fmt --check.
Every mutating command—includinginstall,remove,update,gc, and futurenupm import—must callacquire_mutation_lock(root).
Lockfiles, journals, and state files must usewrite_json_atomic; partial writes are not allowed.
Pending activation, autoload, and lifecycle journals must be stored under$NUMAN_ROOT/state/.
Module autoload identity must match all four fields: Nu executable hash, Nu version, vendor autoload directory, and managed file path; the lockfilemodule_activationvalue is authoritative.
Never overwrite foreign autoload files; respectOWNERSHIP_MARKER.
Pass paths to Nu only throu...
Files:
src/core/resolve.rs
**/*.{rs,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Run and keep
cargo fmt/rustfmtclean, and ensurecargo clippy -- -D warningspasses.
Files:
src/core/resolve.rs
**/*.{rs,nu}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{rs,nu}: Real-Nu acceptance tests must be marked#[ignore]and should be run when changes affect activation or nupm import; unit tests must not spawn realnuand should use injectable seams such asFakeCandidateRunneror registrars.
The nupm integration must be read-only towardNUPM_HOME, must not executebuild.nu, and must not perform bidirectional synchronization.Unit tests must use
FakeCandidateRunneror injectable registrars and must not spawn a realnuprocess.
Files:
src/core/resolve.rs
**/*.{rs,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Match existing naming, module layout, and documentation level in the file being edited; update
AGENTS.md,docs/, or command help when structure, conventions, or user-visible behavior changes.Tests must cover failure modes, not only successful execution.
Files:
src/core/resolve.rs
**/*.{rs,md,toml}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Use the repository's established serialization and module conventions rather than introducing unrelated refactors.
Files:
src/core/resolve.rs
src/core/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Derive the platform triple from compile-time
#[cfg(target_env)]values, notstd::env::consts;LIBCmust be a compile-time constant.
Files:
src/core/resolve.rs
🔍 Remote MCP DeepWiki, GitHub Copilot
Relevant review context
- PR
#112changes onlysrc/core/resolve.rs(+55/−2). It adds a remediation mode distinguishing package-wideresolvefailures from explicit-versionresolve_exactfailures. Package-wide failures suggestnuman search <package-id> --all; exact-version failures suggestnuman info <package-id>and explicitly reject the search hint. - The install transaction calls
resolve_exactonly forowner/name@version; otherwise it callsresolve, so the distinction is correctly placed at the resolver boundary. - Existing repository syntax uses positional managed-Nu versions (
numan setup nu <version>), and the PR does not modify that syntax. - Tests cover both positive and negative guidance for package-wide and exact-version mismatches, including concrete package IDs.
- CI currently reports successful format, clippy, MSRV, Linux/macOS tests, and real-Nu acceptance; Windows tests/acceptance, Rust analysis, and Greptile review were still in progress.
🔇 Additional comments (2)
src/core/resolve.rs (2)
295-295: LGTM!Also applies to: 314-327, 337-342, 376-389
839-846: LGTM!Also applies to: 886-893
| assert!( | ||
| err.contains("numan search test/plugin --all"), | ||
| "expected incompatible-package search hint: {err}" | ||
| ); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win
Keep package-wide and exact-version guidance mutually exclusive.
The package-wide test verifies numan search test/plugin --all, but it does not reject numan info test/plugin. A regression could emit both hints and still pass this test. Add a negative assertion for the exact-version hint.
Proposed assertion
assert!(
err.contains("numan search test/plugin --all"),
"expected incompatible-package search hint: {err}"
);
+ assert!(
+ !err.contains("numan info test/plugin"),
+ "package-wide failures should not suggest exact-version info: {err}"
+ );Based on the change contract, the Resolve and ExactVersion hints must remain distinct.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assert!( | |
| err.contains("numan search test/plugin --all"), | |
| "expected incompatible-package search hint: {err}" | |
| ); | |
| assert!( | |
| err.contains("numan search test/plugin --all"), | |
| "expected incompatible-package search hint: {err}" | |
| ); | |
| assert!( | |
| !err.contains("numan info test/plugin"), | |
| "package-wide failures should not suggest exact-version info: {err}" | |
| ); |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/core/resolve.rs` around lines 810 - 813, Strengthen the assertion in the
relevant resolve test around the existing err check so it also verifies that the
exact-version hint `numan info test/plugin` is absent. Keep the package-wide
`numan search test/plugin --all` assertion, ensuring Resolve and ExactVersion
guidance remain mutually exclusive.
When a package exists but has no compatible version, the error now additionally suggests:
To see why this package is incompatible: numan search <name> --allHelps newcomers understand WHY a package won't install. 14 resolve tests pass.