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

Add base pipeline for importers and migrate PyPa importer to aboutcode pipeline #1559

Merged
merged 9 commits into from
Aug 27, 2024

Conversation

keshav-space
Copy link
Member

@keshav-space keshav-space force-pushed the 1509-pypa-importer-pipeline branch 3 times, most recently from 1364361 to 567f1ec Compare August 26, 2024 16:01
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thank. Some nits for your consideration!

vulnerabilities/importers/pypa.py Show resolved Hide resolved
vulnerabilities/pipelines/__init__.py Outdated Show resolved Hide resolved
vulnerabilities/pipelines/__init__.py Outdated Show resolved Hide resolved

def advisories_count(self):
vulns_path = Path(self.vcs_response.dest_dir) / "vulns"
return sum(1 for _ in vulns_path.rglob("*.yaml"))
Copy link
Member

Choose a reason for hiding this comment

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

What about this too? or is this to avoid using too much memory?

Suggested change
return sum(1 for _ in vulns_path.rglob("*.yaml"))
return len(list(vulns_path.rglob("*.yaml")))

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, did that to avoid keeping all the Path objects in memory at the same time.

vulnerabilities/pipelines/pypa_importer.py Show resolved Hide resolved
vulnerabilities/tests/__init__.py Outdated Show resolved Hide resolved
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

LGTM!

@keshav-space keshav-space merged commit 5b982c6 into main Aug 27, 2024
9 checks passed
@keshav-space keshav-space deleted the 1509-pypa-importer-pipeline branch August 27, 2024 05:59
@keshav-space keshav-space self-assigned this Sep 2, 2024
@pombredanne pombredanne added 1-next and removed 9-next labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants