Skip to content

Nuget Package Updater - Add Central Package Management (CPM) Support - #2

Closed
orto17 wants to merge 4 commits into
feature/nuget-package-updaterfrom
feature/nuget-cpm-support
Closed

orto17 wants to merge 4 commits into
feature/nuget-package-updaterfrom
feature/nuget-cpm-support

Conversation

@orto17

@orto17 orto17 commented Sep 9, 2026

Copy link
Copy Markdown
Owner

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.

  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....
  • All static analysis checks passed.
  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • All changes are detailed at the description. if not already covered at JFrog Documentation, new documentation have been added.

orto17 and others added 4 commits September 17, 2026 11:13
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant