-
Notifications
You must be signed in to change notification settings - Fork 474
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
fix: handle unknown values in metric_finder (Fixes #4578) #4682
base: main
Are you sure you want to change the base?
Conversation
… unknown or a metrics_id)
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.
Looks like you're failing a couple of lint checks because there's some whitespace on a blank line. I've added a comment where I think it's happening, but the best way to be sure it's fixed is to run black cve_bin_tool/cvedb.py
then check your file back in and push it to the PR branch.
Here's some more info on our linters in case you've never run those before:
https://github.com/intel/cve-bin-tool/blob/main/CONTRIBUTING.md#running-linters
It's also complaining about the PR title because it doesn't conform to the commit message format we use, which is https://www.conventionalcommits.org/ -- I'll change the title for you now so it should pass next time but the linter won't run again until you update the branch.
cve_bin_tool/cvedb.py
Outdated
@@ -416,6 +417,9 @@ def init_database(self) -> None: | |||
for table in self.TABLE_SCHEMAS: | |||
cursor.execute(self.TABLE_SCHEMAS[table]) | |||
|
|||
# Ensure the UNKNOWN metric exists | |||
self.ensure_unknown_metric(cursor) | |||
|
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.
The blank line here has some extra spaces or a tab in it.
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.
@terriko can you see why the test case is failing, i'd appreciate it |
Fixes #4578 ([CVEDB] Why does the function metric_finder returns unknown or a ### metrics_id)
Added "UNKNOWN" Metric
Implemented a method (ensure_unknown_metric) to ensure it exists
and updated the metric_finder function
I removed the commits from the other PR, you can check this one out while i'll look into why the tests for #4654 are failing
Thanks and lemme know if we need to change anything