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

Improve purl input #2223

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Improve purl input #2223

merged 2 commits into from
Oct 30, 2024

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Oct 29, 2024

This PR makes a few changes to purl processing:

  • allows for single purl to be provided on the cli: grype pkg:apk/curl@7.61.1 --distro alpine:3.20.3. Closes Add support for scanning single purl from the CLI #2225
  • infers a distro from a set of purls given (as long as there are no conflicting distros provided)
  • fixes #2192, which reported packages being dropped sporadically from scans when using a purl file as input
  • I found that RPM epoch was being added to the version field within the PURL on any packages which are created, which is incorrect. I've updated this to keep the original version field in the PURL intact.

@wagoodman wagoodman added enhancement New feature or request and removed enhancement New feature or request labels Oct 29, 2024
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman force-pushed the refactor-purl-injest branch from d1256cc to 4b48e7f Compare October 30, 2024 13:57
@wagoodman wagoodman marked this pull request as ready for review October 30, 2024 13:57
@wagoodman wagoodman self-assigned this Oct 30, 2024
@wagoodman wagoodman requested a review from a team October 30, 2024 13:57
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

LGTM 👍

cmd/grype/cli/commands/root.go Outdated Show resolved Hide resolved
grype/pkg/purl_provider.go Outdated Show resolved Hide resolved
grype/pkg/purl_provider.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman enabled auto-merge (squash) October 30, 2024 16:57
@wagoodman wagoodman merged commit 0cc544f into main Oct 30, 2024
10 checks passed
@wagoodman wagoodman deleted the refactor-purl-injest branch October 30, 2024 17:16
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.

Add support for scanning single purl from the CLI Flaky checks on STDIN for purl provider
2 participants