Repository navigation
fix(napi): support trustLockfile option - #13489
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an optional ChangesLockfile trust configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 QodoExpose trustLockfile in NAPI install options and config overlay
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Confidence Score: 4/5The implementation appears safe to merge, though the previously requested end-to-end NAPI behavioral coverage remains outstanding. The release changeset is now present and the option is correctly propagated into the downstream verification gate, but the new test stops at resolved configuration and does not exercise lockfile verification through the NAPI install path. Files Needing Attention: pnpm/crates/napi/src/install/tests.rs Reviews (2): Last reviewed commit: "test(napi): cover resolved trust lockfil..." | Re-trigger Greptile |
Code Review by Qodo
Context used✅ Compliance rules (platform):
24 rules 1. Flaky trustLockfile default test
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm/crates/napi/src/install/tests.rs (1)
95-99: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest the resolved configuration, not only the overlay.
These tests would still pass if
build_configstopped applyingtrust_lockfile. Add a focused test coveringSome(false),Some(true), andNoneagainst the resultingConfig; this is the security-sensitive behavior of the option.As per path instructions, “Tests must prove the changed behavior.”
🤖 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 `@pnpm/crates/napi/src/install/tests.rs` around lines 95 - 99, Extend the tests around build_config to assert the resolved Config.trust_lockfile value for Some(false), Some(true), and None, rather than only checking build_overlay in build_overlay_preserves_the_trust_lockfile_default. Configure each input option explicitly and verify the resulting Config preserves the expected value, including the default None case.Source: Path instructions
🤖 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.
Nitpick comments:
In `@pnpm/crates/napi/src/install/tests.rs`:
- Around line 95-99: Extend the tests around build_config to assert the resolved
Config.trust_lockfile value for Some(false), Some(true), and None, rather than
only checking build_overlay in
build_overlay_preserves_the_trust_lockfile_default. Configure each input option
explicitly and verify the resulting Config preserves the expected value,
including the default None case.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b6e716da-fd55-4247-a001-fc0e7519cef6
📒 Files selected for processing (4)
pnpm/crates/napi/src/config.rspnpm/crates/napi/src/install.rspnpm/crates/napi/src/install/tests.rspnpm/npm/napi/index.d.ts
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Micro-Benchmark ResultsLinux |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13489 +/- ##
==========================================
- Coverage 87.92% 87.91% -0.01%
==========================================
Files 549 549
Lines 95534 95538 +4
==========================================
Hits 83995 83995
- Misses 11539 11543 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code review by qodo was updated up to the latest commit 4950856 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Expose trustLockfile through the NAPI InstallOptions and config overlay.
This lets embedders such as Bit explicitly trust existing lockfiles while migrating to pnpm v12. The NAPI and pnpm CLI defaults remain unchanged.
Tests:
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
New Features
trustLockfileinstall setting.Tests