Skip to content

feat: Improve grype error handling #455

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devodev
Copy link

@devodev devodev commented Apr 2, 2025

Starting with Grype v0.92.0, we can correctly infer when an error returned from the CLI is for a failing severity from --fail-on (PR). Adapt the command error handling to make it clear when the action cannot be certain of the error and emit warnings accordingly.

Also I've made sure to fail the action if severity cut off is disabled and an error occurs, which I think is the correct way to make sure errors are correctly surfaced?

I'd love to get more feedback on the overall error handling as well. More specifically, I've added warning logs with stdout/stderr when we can't correctly determine if an error is for a failing severity, otherwise I couldn't find a way to get to the the error without manually running the CLI. Does that make sense?

TODO: wait for Grype v0.92.0 release

Fixes: #390

@devodev devodev force-pushed the pr/devodev/handle-fail-on-error branch from 9b8242e to 53fa032 Compare April 2, 2025 17:01
Starting with Grype v0.92.0, we can correctly infer when
an error returned from the CLI is for a failing severity
from --fail-on. Adapt the command error handling to
make it clear when the action cannot be certain of the
error and emit warnings accordingly.

Signed-off-by: Alexandre Barone <[email protected]>
@devodev devodev force-pushed the pr/devodev/handle-fail-on-error branch from 53fa032 to 86b5f10 Compare April 2, 2025 17:13
@devodev devodev changed the title Improve grype error handling feat: Improve grype error handling Apr 15, 2025
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.

Action continues on non-vulnerability failures
1 participant