Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Syft IDs in JSON output #1266

Merged
merged 4 commits into from
May 5, 2023

Conversation

luhring
Copy link
Contributor

@luhring luhring commented May 4, 2023

Grype's JSON output has been missing the id field on packages.

This PR is a "quick win" / "first iteration" on #1265 — supporting the specific case of Grype scanning a Syft-format SBOM.

This PR also makes an adjustment to how test input data is generated: now that we're comparing IDs, it was a problem that Grype's presenter test code was generating random UUIDs for package IDs on every run. My suggested fix for this is to lean on Syft's deterministic ID generation mechanism instead, but I defer to any ideas you all have!

Also, let me know if you'd like to see additional tests here, such as scanning a Syft JSON test fixture!

cc: @wagoodman

Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Signed-off-by: Dan Luhring <dluhring@chainguard.dev>
Copy link
Contributor

@wagoodman wagoodman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid addition, thanks! 🏅

@wagoodman wagoodman enabled auto-merge (squash) May 5, 2023 13:39
@wagoodman wagoodman merged commit 850a4ac into anchore:main May 5, 2023
@luhring luhring deleted the syft-ids-in-output branch May 5, 2023 13:50
@wagoodman wagoodman added the enhancement New feature or request label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants