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(output): add a unified output result #1397

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Conversation

hogo6002
Copy link
Contributor

@hogo6002 hogo6002 commented Nov 13, 2024

Refactored the HTMLResult into a unified structure that can be reused by other output formats. This new structure presents results hierarchically, grouping vulnerabilities by ecosystem, source, and package. Compare to the original vulnerabilityResult, it contains more information, such as vulnerability count (called/uncalled/fixable/unfixable/severity), package/vulnerability fix information, etc.

Follow-up PRs:

  • Merge this into the v2 branch (via chore: Update v2 to main #1396)
  • Leverage this structure to generate a table package-view output.
  • Update html.go and HTML templates to use the OutputResult.

@codecov-commenter
Copy link

codecov-commenter commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 75.31646% with 78 lines in your changes missing coverage. Please review.

Project coverage is 69.05%. Comparing base (c80f395) to head (b3bcc7c).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
internal/output/output_result.go 75.16% 61 Missing and 14 partials ⚠️
internal/utility/severity/severity.go 57.14% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1397      +/-   ##
==========================================
+ Coverage   68.96%   69.05%   +0.08%     
==========================================
  Files         185      186       +1     
  Lines       17934    18237     +303     
==========================================
+ Hits        12368    12593     +225     
- Misses       4903     4965      +62     
- Partials      663      679      +16     

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


🚨 Try these New Features:

@hogo6002 hogo6002 requested a review from G-Rath November 14, 2024 00:56
Copy link
Collaborator

@another-rex another-rex left a comment

Choose a reason for hiding this comment

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

Thanks! Added some comments.

internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
internal/output/output_result.go Outdated Show resolved Hide resolved
@hogo6002
Copy link
Contributor Author

I'm going to merge this PR first to create the package view for the table output. Feel free to leave comments, and I'll address them in a separate PR.

@hogo6002 hogo6002 merged commit 5e82cf7 into google:main Nov 19, 2024
13 checks passed
hogo6002 added a commit that referenced this pull request Dec 16, 2024
Replaces the `HTMLResult` with the unified [output
`Result`](#1397) for HTML
files.
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.

4 participants