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: Enable metrics if epss-{percentile,probability} is set #3642

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

ffontaine
Copy link
Contributor

Enable metrics if epss-percentile or epss-probability is set by the user. This commit also fix this following broken logic which allowed negative epss values:
if float(args["epss_percentile"]) > 0 or float(args["epss_percentile"]) < 100:

replaced by:

if float(args["epss_percentile"]) >= 0 and float(args["epss_percentile"]) <= 100:

Tentative fix for #3625

@terriko terriko changed the title Enable metrics if epss-{percentile,probability} is set feat: Enable metrics if epss-{percentile,probability} is set Dec 19, 2023
@ffontaine ffontaine force-pushed the fix-3625 branch 2 times, most recently from 26f8fce to cc618a5 Compare December 19, 2023 21:04
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (a168298) 77.76% compared to head (cc618a5) 78.35%.
Report is 15 commits behind head on main.

Files Patch % Lines
cve_bin_tool/cli.py 20.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3642      +/-   ##
==========================================
+ Coverage   77.76%   78.35%   +0.58%     
==========================================
  Files         781      785       +4     
  Lines       11700    11723      +23     
  Branches     1369     1369              
==========================================
+ Hits         9099     9185      +86     
+ Misses       2183     2119      -64     
- Partials      418      419       +1     
Flag Coverage Δ
win-longtests 78.35% <75.00%> (+0.58%) ⬆️

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.

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

Minor help text change, but I think otherwise this looks reasonable.

@@ -279,13 +279,11 @@ def main(argv=None):
"--epss-percentile",
action="store",
help="minimum epss percentile of CVE range between 0 to 100 to report (default: 0)",
default=0,
)
output_group.add_argument(
"--epss-probability",
action="store",
help="minimum epss probability of CVE range between 0 to 100 to report (default: 0)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
help="minimum epss probability of CVE range between 0 to 100 to report (default: 0)",
help="minimum epss probability of CVE range between 0 to 100 to report",

Same as above, no default now so help text needed an update.

@@ -279,13 +279,11 @@ def main(argv=None):
"--epss-percentile",
action="store",
help="minimum epss percentile of CVE range between 0 to 100 to report (default: 0)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
help="minimum epss percentile of CVE range between 0 to 100 to report (default: 0)",
help="minimum epss percentile of CVE range between 0 to 100 to report",

If we're removing the default to make the logic work better, we should also remove the default shown in help text.

cve_bin_tool/cli.py Show resolved Hide resolved
Enable metrics if epss-percentile or epss-probability is set by the
user. This commit also fix this following broken logic which allowed
negative epss values:

if float(args["epss_percentile"]) > 0 or float(args["epss_percentile"]) < 100:

replaced by:

if float(args["epss_percentile"]) >= 0 and float(args["epss_percentile"]) <= 100:

Tentative fix for intel#3625

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

Thanks for updating! I'm going to merge this now since it looks like it's just failing the 20 tests that are having trouble today.

@terriko terriko merged commit 019f1f6 into intel:main Dec 20, 2023
19 of 21 checks passed
@ffontaine ffontaine deleted the fix-3625 branch December 21, 2023 13:47
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