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
Input: comment and severity support #827
Conversation
Codecov Report
@@ Coverage Diff @@
## master #827 +/- ##
==========================================
- Coverage 88.73% 83.44% -5.30%
==========================================
Files 156 156
Lines 2566 2567 +1
Branches 279 278 -1
==========================================
- Hits 2277 2142 -135
- Misses 224 355 +131
- Partials 65 70 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
a3e506f
to
e6170b4
Compare
fix bug no unnecessary change not nec fix space fix bugs
|
|
||
| def __init__( | ||
| self, filename: str, logger: Logger = None, error_mode=ErrorMode.TruncTrace | ||
| ): | ||
| self.filename = os.path.abspath(filename) | ||
| self.logger = logger or LOGGER.getChild(self.__class__.__name__) | ||
| self.error_mode = error_mode | ||
| self.parsed_data = {} | ||
| self.parsed_data = defaultdict(dict) |
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.
Change data structure to incorporate more triage data like comments and custom severity
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.
Can we put a comment about this a few useful places, such as line 35 above? The type hints are good but they don't quite tell the full story about what we're expecting to have in there.
| @@ -33,6 +29,7 @@ def output_csv(all_cve_data, outfile): | |||
| "cve_number", | |||
| "severity", | |||
| "remarks", | |||
| "comments", | |||
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.
comments support :)
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 good, just some nits about comments really.
|
|
||
| def __init__( | ||
| self, filename: str, logger: Logger = None, error_mode=ErrorMode.TruncTrace | ||
| ): | ||
| self.filename = os.path.abspath(filename) | ||
| self.logger = logger or LOGGER.getChild(self.__class__.__name__) | ||
| self.error_mode = error_mode | ||
| self.parsed_data = {} | ||
| self.parsed_data = defaultdict(dict) |
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.
Can we put a comment about this a few useful places, such as line 35 above? The type hints are good but they don't quite tell the full story about what we're expecting to have in there.
cve_bin_tool/input_engine.py
Outdated
|
|
||
| def parse_input(self) -> Dict[tuple, Remarks]: | ||
| def parse_input(self) -> DefaultDict[tuple, Dict[str, Dict[str, Any]]]: |
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.
Another place where remarks told us a lot more than Dict[str, Dict[str, any]] does. Should we be using something like triage_data to replace remarks for clarity?
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.
Yes, We can construct our own type. TriageData and that will solve problem.
| # TriageData is dictionary of cve_number mapped to dictionary of remarks, comments and custom severity | ||
| TriageData = Dict[str, Dict[str, Any]] |
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.
Created alias for TriageData datastructure.
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.
I think this addresses my concern. Just waiting on CI before merging.
Fixes: #486