You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The lock file targets update a dependency with "npm install", "pnpm add" or "yarn add", which save the new version with the package manager default range prefix. A dependency pinned to "2.1.2" was therefore updated to "^2.1.3", loosening the pin.
Pass --save-exact (npm, pnpm) or --exact (yarn) when the package.json version is a strict semantic version, so a pinned dependency stays pinned. Version ranges are unchanged.
Test
To test this pull request, you can run the following commands:
cd pkg/plugins/autodiscovery/npm/
go test
Additional Information
Checklist
I have updated the documentation via pull request in website repository.
I have tested this pull request manually with a custom Updatecli build and it works as expected.
Tradeoff
Potential improvement
Summary by CodeRabbit
Bug Fixes
Commands generated for dependencies pinned to an exact semantic version now preserve that exact version when adding or updating packages with npm, Yarn, and pnpm.
Commands for version ranges continue to use range-based behavior.
The lock file targets update a dependency with "npm install", "pnpm add"
or "yarn add", which save the new version with the package manager
default range prefix. A dependency pinned to "2.1.2" was therefore
updated to "^2.1.3", loosening the pin.
Pass --save-exact (npm, pnpm) or --exact (yarn) when the package.json
version is a strict semantic version, so a pinned dependency stays
pinned. Version ranges are unchanged.
Signed-off-by: Olblak <me@olblak.com>
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 5441ff97-0b09-4930-b2c8-c2b8c5b7410d
Commits
Reviewing files that changed from the base of the PR and between 306b1c8 and a8676e2.
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
No actionable comments were generated in the recent review.
Walkthrough
Dependency discovery now checks whether each version is a strict semantic version and passes that status to the npm, Yarn, and pnpm command builders. Exact versions add the package manager’s exact-version flag; range commands retain their prior flags.
Changes: npm exact-version command generation
Layer / File(s)
Summary
Detect exact versions and build commands pkg/plugins/autodiscovery/npm/utils.go, pkg/plugins/autodiscovery/npm/utils_test.go
isExactVersion returns true when strict semantic-version parsing succeeds. Command builders add --save-exact for npm and pnpm, and --exact for Yarn, when the version is exact. Tests cover exact versions and ranges.
Pass exactness through dependency discovery pkg/plugins/autodiscovery/npm/dependency.go, pkg/plugins/autodiscovery/npm/main_test.go
Dependency discovery passes the exact-version status to the npm, Yarn, and pnpm command builders. The pnpm test expectation includes --save-exact.
Pinned npm dependency versions now stay pinned when lock files are updated, and ranges are left unchanged. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: npm, pnpm, and yarn lock-file updates now keep exact dependency versions exact, using --save-exact or --exact. The title matches the changeset summary, which adds an e…
Description check
The description follows the repository template. It explains the problem (default range prefixes loosen pinned versions) and the fix (--save-exact or --exact for strict semantic versions, ranges uncha…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: npm, pnpm, and yarn lock-file updates now keep exact dependency versions exact, using --save-exact or --exact. The title matches the changeset summary, which adds an exact-version flag to getTargetCommand and an isExactVersion helper.
Full details: Description check
Explanation
The description follows the repository template. It explains the problem (default range prefixes loosen pinned versions) and the fix (--save-exact or --exact for strict semantic versions, ranges unchanged). It keeps the Fix #XXX line, the Test section with the correct go test directory, and the Checklist, Tradeoff, and Potential improvement sections. The 'Fix #XXX' placeholder still needs a real issue number. The checklist items are unchecked, and the description does not state whether manual testing was done. The Tradeoff and Potential improvement sections keep their template placeholder comments and have no content.
Resolution
Replace the 'Fix #XXX' placeholder with the linked issue number. Add or remove the optional Tradeoff and Potential improvement content. Mark the checklist items that apply, and state whether manual testing was done.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 154f4fda-e55c-498e-abd4-825623bbca3b
Commits
Reviewing files that changed from the base of the PR and between cfc0074 and 306b1c8.
Files selected for processing: 4
pkg/plugins/autodiscovery/npm/dependency.go
pkg/plugins/autodiscovery/npm/main_test.go
pkg/plugins/autodiscovery/npm/utils.go
pkg/plugins/autodiscovery/npm/utils_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
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
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.
The lock file targets update a dependency with "npm install", "pnpm add" or "yarn add", which save the new version with the package manager default range prefix. A dependency pinned to "2.1.2" was therefore updated to "^2.1.3", loosening the pin.
Pass --save-exact (npm, pnpm) or --exact (yarn) when the package.json version is a strict semantic version, so a pinned dependency stays pinned. Version ranges are unchanged.
Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement
Summary by CodeRabbit