Skip to content

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

/cc @lamppu @Etsija

Copy link

codecov bot commented Nov 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.00%. Comparing base (adbc271) to head (b7a28c2).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9525   +/-   ##
=========================================
  Coverage     68.00%   68.00%           
  Complexity     1291     1291           
=========================================
  Files           249      249           
  Lines          8819     8819           
  Branches        917      917           
=========================================
  Hits           5997     5997           
  Misses         2433     2433           
  Partials        389      389           
Flag Coverage Δ
funTest-non-docker 33.29% <ø> (ø)
test 35.83% <ø> (ø)

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.

reference
.let {
// Treat "MODERATE" as an alias for "MEDIUM" independently of the scoring system.
if (it.severity == "MODERATE") reference.copy(severity = "MEDIUM") else it
Copy link
Member

Choose a reason for hiding this comment

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

Should be it.copy, but maybe also switch from let to run altogether.

Copy link
Member Author

Choose a reason for hiding this comment

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

BTW, this is one of the cases where I've wondered whether we should make use of var instead of val in model data classes. Being able to reassign properties instead of making copies of the parent object would be so much more memory-friendly, and probably also result in more readable code.

Copy link
Member

Choose a reason for hiding this comment

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

So you want to do pandora.box.open = true instead of pandora.copy(box = pandora.box.copy(open = true))? 😜

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, for some selected properties in selected data classes where we expect data to be fixed-up. If we had proper abstractions of the data models from the APIs, this could be made so that such fixups are only allowed by the producers of the data, but not the consumers (which get an immutable view on the data).

Avoid judgy "old" / "new" terms and use "existing" / "additional"
instead.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
In all practical cases, OSV's "score" field holds the CVSS vector string,
so rename the variable accordingly to avoid confusion with ORT's
"severity" string.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
There are more advisors than VulnerableCode that report "MODERATE"
instead of "MEDIUM" as a severity. To address this, generally normalize
vulnerability data independently of the advisor. This guarantees uniform
data for more convenient use in rules and other places that implement
conditions based on e.g. the severity, and results in a more consistent
experience when displaying results in a UI.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
@sschuberth
Copy link
Member Author

Merging prematurely as relevant checks have passed.

@sschuberth sschuberth disabled auto-merge December 5, 2024 08:36
@sschuberth sschuberth merged commit b5cc0ea into main Dec 5, 2024
22 of 23 checks passed
@sschuberth sschuberth deleted the advisor-imps branch December 5, 2024 08:36
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.

2 participants