Repository navigation
Nuget Package Updater - CPM Support - #888
Merged
Merged
Conversation
When a PackageReference has no inline version, before giving up: check
for a local VersionOverride attribute first (wins over CPM entirely if
present), otherwise walk up from the project's directory toward the repo
root looking for the nearest Directory.Packages.props - the same
resolution NuGet itself uses, so nested/multiple CPM files naturally
resolve to whichever governs that specific project ("closest wins").
The matching PackageVersion entry there is patched instead of the
evidence file; the evidenced project's own lock file is still
regenerated afterward, since its resolved version now depends on that
central file.
NoInlineVersionFixNotSupported now only covers what's genuinely left
unresolvable: a governing file that doesn't declare the package, or no
Directory.Packages.props found in the ancestor chain at all.
Sibling projects that share the same governing file but weren't
evidenced are not proactively restored - a known scope boundary, not a
gap: their own lock files can go stale relative to the bumped central
version until they're separately evidenced and fixed.
…root bounds. Co-authored-by: Cursor <cursoragent@cursor.com>
Evidence for a CPM- or Directory.Build.props-resolved package only ever points at packages.lock.json, never the .csproj - the version text never appears there at all. techutils' Nuget descriptor list didn't recognize lock files, so that evidence was discarded before reaching any updater. Added it there, and taught collectProjectFilePaths to resolve a lock-file evidence path to the sibling project file in the same directory. Added a Directory.Build.props/.targets fallback, tried after Central Package Management comes back unresolved, reusing the same walk-up and Import-following logic (generalized from the CPM-only version). Broadened the fallback trigger to any failure from the inline-version check, not just "found without a version" - a package injected purely via Directory.Build.props has no local PackageReference to find at all, which previously returned a plain "not found" that never attempted the fallback chain. Resolved $(MSBuildThisFileDirectory) in Import paths before checking for unresolvable macros, since it's a trivial, common case that doesn't need full MSBuild evaluation.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…fix Join lint. Stop falling through to Directory.Packages.props when a project mixes inline and versionless PackageReferences, keep lock-file evidence from winning over project files, and drop single-argument filepath.Join calls that fail gocritic. Co-authored-by: Cursor <cursoragent@cursor.com>
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
reviewed
Sep 22, 2026
Jordanh1996
requested changes
Sep 22, 2026
…isclassification, backslash Import paths, attributed CPM tag, dedupe/precompile regexes - Mask XML comments before element-matching so a commented-out pin is never rewritten or mistaken for a live entry that ends the Import-chain descent early. - Drop MixedInlineAndNonInlineVersionFixNotSupported: a versionless sibling (e.g. an Update= metadata overlay) no longer blocks a fix that already found and bumped a real versioned entry. - Normalize backslash-separated MSBuild Import paths before joining, so Windows-style relative paths resolve on any OS. - Allow attributes (e.g. Condition) on <ManagePackageVersionsCentrally> instead of requiring a bare tag. - Reuse nugetKeyAttrPattern instead of a duplicate constant, and compile all non-parameterized regexes once at package init instead of per call. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Jordanh1996
approved these changes
Sep 23, 2026
This branch had an error being deployed
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.
devbranch.go vet ./....go fmt ./....Adds Central Package Management (CPM) support to the NuGet fix updater, on top of the plain-PackageReference support merged in jfrog/jfrog-cli-security#874. Goal: keep "fixable by our updater" equal to "detected by the scanner" for NuGet — if Xray can find a version string to bump, this updater should be able to bump it.
Out of scope