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

fix: handle unknown values in metric_finder (Fixes #4578) #4682

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vedpawar2254
Copy link
Contributor

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

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.

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.

@@ -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)

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @terriko , it should be good now, my vs code extensions are messing with me 😅, also there are some broken links in MANUAL.md as pointed out by @Molkree, i'll raise a pr to fix it, should i also create a issue.
I think I'll also checkout the other docs to see if there are any broken links or smtg

@terriko terriko changed the title Fixes #4578 ([CVEDB] Why does the function metric_finder returns unkn… fix: handle unknown values in metric_finder (Fixes #4578) Jan 10, 2025
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.

[CVEDB] Why does the function metric_finder returns unknown or a metrics_id
2 participants