fix(security): keep OSV downloads atomic, bound the issue sync and lint every suppression entry

CodeRabbit review of PR #1326:

- fetch_databases downloads each OSV archive to all.zip.part and replaces
  all.zip only after the transfer completes. An OSError removes the partial
  file and comes back as an `osv <ecosystem>: <error>` line instead of a
  traceback.
- run_gh bounds every gh call with a 120 s timeout. A failed or hung create,
  edit or close becomes a `failed <action>: <error>` line while the other
  issues and the close pass still run, and the command exits 1.
- The suppression lint checks every list item of a suppressions block, so an
  entry that starts with `until:` still needs its `# nocheck: cve <reason>`
  marker.

Part of #1324

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-11-01 12:45:24 +01:00
1 parent 3531b95de0
commit 090e3c115d
5 files changed
+98 -48

No files matched your search

@@ -72,6 +72,16 @@ class TestFetchDatabases(_Root):
errors, _calls, _downloads = self._fetch(["trivy"], 0)
self.assertTrue(any("provided database" in error for error in errors))
def test_an_interrupted_osv_download_leaves_no_zip_and_is_reported(self):
def fetch(url, destination):
destination.write_bytes(b"trunc")
raise TimeoutError("timed out")
errors = database.fetch_databases(P, self.root, ["osv"], None, fetch)
ubuntu = self.root / "osv" / "osv-scalibr" / "Ubuntu"
self.assertIn("osv Ubuntu: timed out", errors)
self.assertEqual(list(ubuntu.iterdir()), [])
class TestStale(_Root):
def test_a_missing_database_is_stale(self):