Skip to content

Commit f164ede

Browse files
committed
Clean up checkpoint importer
Signed-off-by: Anmol Vats <anmolvats2003@gmail.com>
1 parent 7efd230 commit f164ede

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

vulnerabilities/pipelines/v2_importers/checkpoint_importer.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ def fetch_all_advisory_rows(log_fn) -> Iterable[dict]:
9494

9595
soup = BeautifulSoup(resp.text, features="lxml")
9696
years = get_available_years(soup)
97-
if not years:
98-
log_fn("No years found on advisories page")
99-
return
10097

10198
for year in years:
10299
url = f"{ADVISORY_LIST_URL}?year={year}"
@@ -132,7 +129,6 @@ def parse_table_rows(html: str) -> list:
132129
rows = []
133130
for tr in table.find_all("tr")[1:]:
134131
cells = tr.find_all("td")
135-
# 7 cols: Severity, Date Published, Date Updated, CPAI Ref, Source, Industry Ref, Description
136132
if len(cells) < 7:
137133
continue
138134

@@ -146,7 +142,6 @@ def parse_table_rows(html: str) -> list:
146142

147143
cve_link = cells[5].find("a")
148144
cve_text = cve_link.get_text(strip=True) if cve_link else cells[5].get_text(strip=True)
149-
# strip " (and N others)" if present
150145
cve_id = cve_text.split(" (")[0].strip()
151146

152147
summary_link = cells[6].find("a")

vulnerabilities/tests/pipelines/v2_importers/test_checkpoint_importer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def test_first_row_advisory_url(self):
7979
assert SAMPLE_ROWS[0]["advisory_url"].endswith("cpai-2026-1780.html")
8080

8181
def test_cve_id_stripped_of_extra_text(self):
82-
# "CVE-2025-33603 (and 2 others)" should be stripped to "CVE-2025-33603"
8382
assert SAMPLE_ROWS[2]["cve_id"] == "CVE-2025-33603"
8483

8584
def test_returns_empty_list_for_missing_table(self):
@@ -136,7 +135,6 @@ def test_original_advisory_text_is_pretty_json(self):
136135
advisory = parse_advisory(self.row)
137136
parsed = json.loads(advisory.original_advisory_text)
138137
assert parsed["advisory_id"] == "CPAI-2026-1780"
139-
# pretty-printed: should have newlines
140138
assert "\n" in advisory.original_advisory_text
141139

142140
def test_missing_id_returns_none(self):

0 commit comments

Comments
 (0)