Add CloudVulnDB importer for issue #1511#2217
Open
Tednoob17 wants to merge 3 commits intoaboutcode-org:mainfrom
Open
Add CloudVulnDB importer for issue #1511#2217Tednoob17 wants to merge 3 commits intoaboutcode-org:mainfrom
Tednoob17 wants to merge 3 commits intoaboutcode-org:mainfrom
Conversation
- add CloudVulnDB v2 importer pipeline - register importer - add tests and fixtures - ignore setup.py in pytest collection
There was a problem hiding this comment.
Pull request overview
Adds a new v2 importer pipeline to ingest CloudVulnDB advisories from the project’s public RSS feed, along with fixtures/tests and a pytest configuration tweak to avoid collecting setup.py in Docker.
Changes:
- Introduce
CloudVulnDBImporterPipelineand RSS parsing helpers to produceAdvisoryDataV2. - Register the new importer in the central importer registry.
- Add unit tests + RSS/XML and expected JSON fixtures; update pytest
addoptsto ignoresetup.pyduring collection.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vulnerabilities/pipelines/v2_importers/cloudvulndb_importer.py | New CloudVulnDB RSS-based v2 importer implementation. |
| vulnerabilities/importers/init.py | Registers the new v2 importer in the importers registry. |
| vulnerabilities/tests/test_cloudvulndb_importer.py | Adds unit tests for RSS parsing and advisory ID derivation. |
| vulnerabilities/tests/test_data/cloudvulndb/cloudvulndb_rss_mock.xml | Adds mocked RSS fixture for deterministic tests. |
| vulnerabilities/tests/test_data/cloudvulndb/expected_cloudvulndb_advisory_output1.json | Adds expected AdvisoryDataV2 JSON output fixture. |
| pyproject.toml | Updates pytest collection options to ignore setup.py. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| def get_feed_items(self): | ||
| if self._cached_items is None: | ||
| response = fetch_response(CLOUDVULNDB_RSS_URL) | ||
| self._cached_items = parse_rss_feed(response.text) |
Comment on lines
+61
to
+69
| def parse_rss_feed(xml_text: str) -> list: | ||
| """ | ||
| Parse CloudVulnDB RSS XML and return a list of item dictionaries. | ||
| Each dictionary has ``title``, ``link``, ``description``, ``pub_date`` and ``guid`` keys. | ||
| """ | ||
| try: | ||
| root = ElementTree.fromstring(xml_text) | ||
| except ElementTree.ParseError as e: | ||
| logger.error("Failed to parse CloudVulnDB RSS XML: %s", e) |
| # image. Without this, pytest (which uses python_files = "*.py") tries to | ||
| # collect setup.py as a test module and crashes with exit code 2. | ||
| "--ignore=setup.py", | ||
| "--ignore-glob=*/setup.py", |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a new v2 importer for CloudVulnDB from the public RSS feed.
Changes
Testing