-
-
Notifications
You must be signed in to change notification settings - Fork 233
Modify NPM importer to support package-first mode #1941
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
base: main
Are you sure you want to change the base?
Conversation
* Update NPM importer to filter and process advisories relevant to the purl passed in the constructor * Update NPM v2 importer to filter and process advisories relevant to the purl passed in the constructor * Update NPM importer tests to test package-first mode * Update NPM v2 importer tests to test package-first mode Signed-off-by: Michael Ehab Mikhail <michael.ehab@hotmail.com>
…1936 Signed-off-by: Michael Ehab Mikhail <michael.ehab@hotmail.com>
@classmethod | ||
def steps(cls): | ||
return ( | ||
return [ |
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.
Why this change ?
advisory_files = filtered_files | ||
|
||
for advisory in list(advisory_files): | ||
for result in self.to_advisory_data(advisory): |
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.
Why we are not using yield from here ?
advisory_files = list(vuln_directory.glob("*.json")) | ||
|
||
if not self.is_batch_run: | ||
package_name = self.purl.name |
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.
Why we not actually check in our DB if the purl exists, before even checking all files ?
Solves #1936