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

feat(guided remediation): non-interactive JSON output format #1437

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

michaelkedar
Copy link
Member

@michaelkedar michaelkedar commented Dec 10, 2024

Closes #1213
Adds --format flag to osv-scanner fix --non-interactive to choose between old text and new json format, which provides a more machine-readable description of the changes made by guided remediation. The text format should remain unchanged.

Also, renamed the relock strategy to relax (though maintained backwards-compatibility) to be a bit less ambiguous.

There are a few things that'll need to change with osv-scanner v2. In particular, the way the reporter interface is being used. I'll need to revisit this when those are refactored.

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 62.98701% with 114 lines in your changes missing coverage. Please review.

Project coverage is 67.17%. Comparing base (f75ac88) to head (a5ba738).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/osv-scanner/fix/noninteractive.go 72.94% 36 Missing and 10 partials ⚠️
cmd/osv-scanner/fix/output.go 61.64% 26 Missing and 2 partials ⚠️
cmd/osv-scanner/fix/state-relock-result.go 0.00% 15 Missing ⚠️
cmd/osv-scanner/fix/main.go 65.78% 12 Missing and 1 partial ⚠️
cmd/osv-scanner/fix/model.go 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1437      +/-   ##
==========================================
- Coverage   69.58%   67.17%   -2.42%     
==========================================
  Files         186      193       +7     
  Lines       18354    18287      -67     
==========================================
- Hits        12772    12284     -488     
- Misses       4890     5348     +458     
+ Partials      692      655      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michaelkedar michaelkedar changed the title feat(guided remediation): non-interactive JSON output format (WIP) feat(guided remediation): non-interactive JSON output format Dec 17, 2024
@michaelkedar michaelkedar marked this pull request as ready for review December 17, 2024 03:35
Copy link
Contributor

@cuixq cuixq left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

Choose a reason for hiding this comment

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

can you add documentation to these newly defined structs?

Copy link
Member Author

Choose a reason for hiding this comment

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

documentation added

cmd/osv-scanner/fix_test.go Outdated Show resolved Hide resolved
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.

Better osv-scanner fix --non-interactive output
4 participants