[K9VULN-14776] Emit pyproject manifest metadata#142
Conversation
ac79ebf to
08219ba
Compare
|
🎯 Code Coverage (details) 🔗 Commit SHA: 19880cc | Docs | Datadog PR Page | Give us feedback! |
c343465 to
a77c687
Compare
a77c687 to
30e4a40
Compare
30e4a40 to
f4cfddf
Compare
f4cfddf to
19880cc
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19880cccce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| Name: dependency.Name, | ||
| Version: dependency.Version, | ||
| VersionRange: dependency.VersionRange, |
There was a problem hiding this comment.
Preserve distinct pyproject version ranges
When the same dependency name is declared with different pyproject constraints, this creates separate PackageDetails entries that all have an empty Version and only differ by VersionRange. Later sanitizeScannedPackages gives each of them the same unversioned PURL (for example pkg:pypi/requests), and purl.Group keys components by that PURL, so PackageMetadata.Merge keeps only the first version-range value and silently drops the other constraint. This produces an SBOM/API payload with an incorrect range whenever a package is constrained differently across prod/optional/dev groups or files; the range needs to be part of the grouping identity or the ranges need to be explicitly combined before grouping.
Useful? React with 👍 / 👎.
Motivation
Manifest-only
pyproject.tomlscans need enough metadata for downstream SCA enrichment: ranged dependencies should keep their declared range, and manifest-only dependencies should be marked for transitive enrichment.Documentation
Summary
Adds manifest-only dependency metadata for
pyproject.tomlscans.Version.VersionRange, including wildcard ranges like1.*.datadog:version-rangeonly for ranged dependencies.datadog:requires-transitive-enrichment=truefor all emitted pyproject manifest dependencies.Testing
Recovery
Notes for on-call - select only one: