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
[ANE-2809] Add NuGet Central Package Management (CPM) support (#1694)
* [ANE-2809] Add NuGet Central Package Management (CPM) support
When .csproj files use CPM, PackageReference elements omit the Version
attribute—versions live in Directory.Packages.props instead. Previously
these deps were sent to the backend with no version, causing FOSSA to
resolve the latest from NuGet.org and produce false-positive license and
vulnerability results.
Walk parent directories from each project file looking for
Directory.Packages.props, parse its PackageVersion entries into a
version map, and fill in any missing PackageReference versions before
building the dependency graph. Inline Version attributes still take
precedence.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add integration test for NuGet CPM version resolution
Runs the full NuGet discover → analyze pipeline on a local fixture with
Directory.Packages.props + a .csproj that omits versions. Verifies:
- CPM versions are resolved for versionless PackageReferences
- Inline versions take precedence over CPM versions
- Graph breadth is Partial and all deps are NuGetType
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix hlint warnings: eta-reduce analyze', use traverse over mapM
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Replace local CPM test with FixtureArtifact-based integration test
Remove the local-testdata-style NugetCpmSpec and add a proper
FixtureArtifact test to NugetSpec using DapperLib/DapperAOT@1.0.48,
a real project that uses NuGet Central Package Management. The test
downloads the archive and verifies discovery finds all 11 .csproj
targets with CPM version resolution.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address review feedback: case-insensitive NuGet IDs, qualified imports, stronger assertions
- Normalize CPM version map keys with Text.toCaseFold in buildVersionMap
and use toCaseFold on lookup in buildGraphWithCPM, since NuGet package
IDs are case-insensitive
- Add mixed-case package entry to test fixture and assertions to verify
case-folded lookup
- Use explicit qualified imports in DirectoryPackagesPropsSpec
- Add expectDirect/expectEdges to "prefers inline version" test case
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Add PR link to changelog entry for NuGet CPM support
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Assert CPM-resolved versions in DapperAOT integration test
Beyond target count, verify that PackageReferences in
Dapper.AOT.Test.Integration.csproj (all versionless) resolve to the
exact versions pinned in Directory.Packages.props — proving the NuGet
CPM catalog is actually driving dep versions.
* Move NuGet CPM entry from released 3.17.1 to Unreleased
3.17.1 has already been released, so the CPM entry belongs in the
Unreleased section for this PR.
* Bump changelog section to 3.17.3
* Fold Swift and NuGet CPM entries into 3.17.2
3.17.2 is not yet released, so these changes belong in that section.
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: Changelog.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
# FOSSA CLI Changelog
2
2
3
-
## Unreleased
4
-
5
-
- Swift: Fix a bug in the `Package.swift` parser which would cause it to error on valid syntax.
6
-
7
3
## 3.17.2
8
4
5
+
- Swift: Fix a bug in the `Package.swift` parser which would cause it to error on valid syntax.
6
+
- NuGet: Add Central Package Management (CPM) support — versions defined in `Directory.Packages.props` are now resolved for `PackageReference` entries that omit a `Version` attribute. ([#1694](https://github.com/fossas/fossa-cli/pull/1694))
9
7
- Poetry: Support PEP 621 `[project].dependencies` for Poetry 2.x projects. Production dependencies declared in the standard `[project]` section are now correctly detected alongside legacy `[tool.poetry.dependencies]`. ([#1683](https://github.com/fossas/fossa-cli/pull/1683))
Projects using [NuGet Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management) define dependency versions in a `Directory.Packages.props` file rather than in individual project files. When a `PackageReference` has no `Version` attribute, FOSSA searches parent directories for `Directory.Packages.props` and resolves the version from matching `PackageVersion` entries:
0 commit comments