Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
da2a1d9 to
ac64e17
Compare
kzantow
approved these changes
May 20, 2025
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.
With #3853 we began creating
pkg.JavaArchive.PomPropertiesmetadata fields populated from the purl fields (groupid = namespace, artifactid = name). This is generally OK, however, can cause confusion when looking at only the syft json output for a package when the SBOM was decoded from any format into syft json: it makes it seem that we conclusively found apom.propertiesfile on disk during the analysis even though that's not necessarily true.Even more confusing, if you take syft json output that does not have
pkg.JavaArchive.PomPropertiespopulated and you runsyft convert -o json(the same format) the field is populated.For this reason this PR makes a small alteration: we don't generate any
pkg.JavaArchive.PomPropertiesfrom purl info.However, we don't want to drop CycloneDX group information when it is present. It makes sense when encoding and decoding to use this pom properties field (as this is symmetric) when a cyclonedx property hints that the syft metadataType is
JavaArchive. It doesn't make sense to make that same assumption when there are no syft specific properties (when the user is bringing their own CDX document). In this case the group information should already be encoded into the purl for the case of java, or if there is no PURL, syft now generates a PURL with the group encoded as the namespace (unless the purl type is empty orgeneric).Downstream in grype a change will be needed to still derive the group ID and artifact ID from the PURL when it can't be found anywhere else.
Type of change
Checklist