-
Notifications
You must be signed in to change notification settings - Fork 478
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
Conversation
26f8fce
to
cc618a5
Compare
Codecov ReportAttention:
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this 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.
cve_bin_tool/cli.py
Outdated
@@ -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)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
cve_bin_tool/cli.py
Outdated
@@ -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)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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>
There was a problem hiding this 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.
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