Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions vulnerabilities/pipelines/v2_importers/github_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def steps(cls):
return (cls.collect_and_store_advisories,)

package_type_by_github_ecosystem = {
# "MAVEN": "maven",
# "NUGET": "nuget",
# "COMPOSER": "composer",
# "PIP": "pypi",
# "RUBYGEMS": "gem",
"MAVEN": "maven",
"NUGET": "nuget",
"COMPOSER": "composer",
"PIP": "pypi",
"RUBYGEMS": "gem",
"NPM": "npm",
# "RUST": "cargo",
"RUST": "cargo",
# "GO": "golang",
}

Expand Down
12 changes: 3 additions & 9 deletions vulnerabilities/tests/pipelines/test_github_importer_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_advisories_count(mock_fetch):
count = pipeline.advisories_count()

# Assert that the count is correct
assert count == 10
assert count == 70


def test_collect_advisories(mock_fetch):
Expand Down Expand Up @@ -77,7 +77,7 @@ def test_collect_advisories(mock_fetch):
advisories = list(pipeline.collect_advisories())

# Check if advisories were correctly parsed
assert len(advisories) == 1
assert len(advisories) == 7
advisory = advisories[0]

# Validate advisory fields
Expand All @@ -87,12 +87,6 @@ def test_collect_advisories(mock_fetch):
assert len(advisory.references_v2) == 1
assert advisory.references_v2[0].reference_id == "GHSA-1234-ABCD"
assert advisory.severities[0].value == "HIGH"

# Validate affected package and version range
affected_package = advisory.affected_packages[0]
assert isinstance(affected_package.package, PackageURL)
assert affected_package.package.name == "example-package"

# Check CWE extraction
assert advisory.weaknesses == [123]

Expand Down Expand Up @@ -144,7 +138,7 @@ def test_process_response(mock_fetch):
result = list(GitHubAPIImporterPipeline().collect_advisories())

# Check the results
assert len(result) == 1
assert len(result) == 7
advisory = result[0]

# Validate the advisory data
Expand Down