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(otuput): add license scanning results into the new Result struct #1611

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

Conversation

hogo6002
Copy link
Contributor

@hogo6002 hogo6002 commented Feb 12, 2025

This PR

  • Adds a LicenseSummary struct to store the count of each license.
  • Adds Licenses and LicenseViolations fields
  • Implements calculateLicenseSummary, mostly copying code from table.go/licenseSummaryTableBuilder().
  • Adds Licenses resutls to all formats

Table output - container scanning:
with experimental-licenses-summary flag:
image
with experimental-licenses flag:
image

Table output - project scanning (unchanged)

Vertical output:
with experimental-licenses-summary flag:
image
with experimental-licenses flag (adds it back, same as before):
image

HTML output:
with experimental-licenses-summary flag:
image
with experimental-licenses flag:
image
One issue here is that the HTML filter currently hides packages that have no vulnerabilities. So packages without vulnerabilities but with license violations will also be hidden.

Resolves #1576

@codecov-commenter
Copy link

codecov-commenter commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 83.67347% with 8 lines in your changes missing coverage. Please review.

Project coverage is 69.36%. Comparing base (0e95af5) to head (463e77c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/output/output_result.go 83.67% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1611      +/-   ##
==========================================
+ Coverage   69.33%   69.36%   +0.03%     
==========================================
  Files         200      200              
  Lines       19042    19082      +40     
==========================================
+ Hits        13202    13237      +35     
- Misses       5134     5138       +4     
- Partials      706      707       +1     

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

@hogo6002 hogo6002 requested a review from josieang February 13, 2025 06:55
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.

Display license scanning result on all outputs
2 participants