Uh oh!
There was an error while loading. Please reload this page.
migrate current alpine importer to alpine importer-improver model - #623
Conversation
TG1999
commented
Feb 11, 2022
for issue #620 |
Hritik14
commented
Feb 13, 2022
@TG1999 As the development in this branch is going on and we wanted to move ahead with #476, rebasing/merging this with/from main will likely cause merge conflicts. Please accept the incoming changes for the import statements. |
7baa3d2 to
cad46c2CompareTG1999
commented
Feb 14, 2022
@Hritik14 Resolved merge conflicts |
b68f076 to
3360eb3CompareTG1999
commented
Feb 17, 2022
50ba90a to
5ff44feCompareTG1999
commented
Feb 17, 2022
@pombredanne@Hritik14@sbs2001 Please check my current approach for the importer, if this looks good I will proceed with writing tests for this |
pombredanne
left a comment
There was a problem hiding this comment.
Here are a few nits for your review!
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| def __post_init__(self): | ||
| if self.package.version: | ||
| if self.package.version or not (self.affected_version_range or self.fixed_version): | ||
| raise ValueError |
| return advisories | ||
| # TODO: Handle the CVE-????-????? case | ||
| yield AdvisoryData( | ||
| summary="", |
There was a problem hiding this comment.
Why an empty summary? Is is mandatory?
| ), | ||
| fixed_version=AlpineLinuxVersion(version), | ||
| ) | ||
| for arch in archs |
| yield AdvisoryData( | ||
| summary="", | ||
| references=references, | ||
| affected_packages=[ |
There was a problem hiding this comment.
Create this before in a separate easier to read loop
| ) | ||
| for arch in archs | ||
| ], | ||
| aliases=[vuln_ids[0] if is_cve(vuln_ids[0]) else ""], |
There was a problem hiding this comment.
Do not return a list of aliases with an empty string in it.
| def get_exact_purls(affected_package: AffectedPackage) -> (List[PackageURL], PackageURL): | ||
| def get_exact_purls(affected_package: AffectedPackage) -> Tuple[List[PackageURL], PackageURL]: |
There was a problem hiding this comment.
Move these changes in a separate PR.
a9172e4 to
7233a37Compare
pombredanne
left a comment
There was a problem hiding this comment.
Thank you. LGTM... just a few cosmetic nits for your consideration. Could you also add some tests?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
630e608 to
cb83ceeCompare7bdea4c to
4d9b13aCompare
Hritik14
left a comment
There was a problem hiding this comment.
Thanks for the PR! I've marked a few things that I'd like you to consider.
Also, In general, there are a lot of asserts. IMO a loud logging mechanism should serve for those asserts than failing entirely and much of the asserts should make their place in the tests.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4d9b13a to
5d1952eCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
7171d02 to
a3ade32CompareCurrent alpine importer models need to be refactored to give AdvisoryData instead of Advisory, also add some validation to parse license expression and make affected_version_range optional Add tests to test scraping of webpages and parsing of data Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
a3ade32 to
a69c886Compare1fdd165 to
104c760Compare
Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com