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

helper-cli: Allow to specify purls in package lists used for creating analyzer results #9529

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented Dec 2, 2024

Support injecting purls for packages when creating an analyzer result from a PackageList, to allow using the analyzer results as-is with purl-based advisors, such as OSV and (the upcoming) BlackDuck.

Related to: #8739.

@fviernau fviernau requested a review from a team as a code owner December 2, 2024 09:43
@fviernau fviernau force-pushed the helper-cli-package-list-add-purl branch 3 times, most recently from 6f1b2ba to fe8d915 Compare December 2, 2024 09:55
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.99%. Comparing base (eb22e04) to head (dcde910).
Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9529      +/-   ##
============================================
+ Coverage     67.97%   67.99%   +0.01%     
  Complexity     1290     1290              
============================================
  Files           249      249              
  Lines          8813     8818       +5     
  Branches        916      917       +1     
============================================
+ Hits           5991     5996       +5     
  Misses         2433     2433              
  Partials        389      389              
Flag Coverage Δ
funTest-docker 64.84% <ø> (ø)
funTest-non-docker 33.30% <100.00%> (+0.05%) ⬆️
test 35.82% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

mnonnenmacher
mnonnenmacher previously approved these changes Dec 2, 2024
nnobelis
nnobelis previously approved these changes Dec 2, 2024
Call the constructor directly, in order to make use of the default
values `purl = id.toPurl()` and `vcsProcessed = vcs.normalize()`. This
has the effect that `purl` is not empty anymore, but set to the above
mentioned default value derived from the `id`.

This enables using the analyzer results created by this helper command
as-is as input for purl-based advisors.

Signed-off-by: Frank Viernau <[email protected]>
@sschuberth sschuberth changed the title helper-cli: Allow the specify purls in package lists used for creating analyzer results helper-cli: Allow to specify purls in package lists used for creating analyzer results Dec 2, 2024
The `CreateAnalyzerResultFromPackageListCommand` can be used for
projects which do not use a package manager supported by ORT or at all.

In this case the currently used value `purl = id.toPurl()` always
yields a `purl` with the type `generic`. This is not always optimal.
For example, for dependencies of a CMAKE project the purl type `github`
can be more suitable for dependencies hosted on GitHub. Setting the
purl manually via the `PackageList` allows to use the created analyzer
result as-is with any purl-based advisor.

Signed-off-by: Frank Viernau <[email protected]>
@fviernau fviernau dismissed stale reviews from nnobelis and mnonnenmacher via dcde910 December 2, 2024 10:47
@fviernau fviernau force-pushed the helper-cli-package-list-add-purl branch from cf3c86b to dcde910 Compare December 2, 2024 10:47
@fviernau fviernau enabled auto-merge (rebase) December 2, 2024 11:37
@fviernau fviernau merged commit 8b56475 into main Dec 2, 2024
23 checks passed
@fviernau fviernau deleted the helper-cli-package-list-add-purl branch December 2, 2024 12:17
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.

3 participants