Skip to content

Commit

Permalink
feat(importer): instrument REST API importing (#2753)
Browse files Browse the repository at this point in the history
Currently the REST API is entirely silent about what records it is
processing. This commit addresses that and makes the instrumentation
more in line with the Git and GCS sources, for easier debugging.
  • Loading branch information
andrewpollock authored Oct 16, 2024
1 parent b0d9667 commit e814468
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ def _process_updates_rest(self, source_repo: osv.SourceRepository):
request.text, source_repo.extension, strict=self._strict_validation)

vulns_last_modified = last_update_date
logging.info('%d records to consider', len(vulns))
# Create tasks for changed files.
for vuln in vulns:
import_failure_logs = []
Expand All @@ -730,6 +731,8 @@ def _process_updates_rest(self, source_repo: osv.SourceRepository):
_ = osv.parse_vulnerability_from_dict(single_vuln.json(),
source_repo.key_path,
self._strict_validation)
logging.info('Requesting analysis of REST record: %s',
vuln.id + source_repo.extension)
self._request_analysis_external(
source_repo, osv.sha256_bytes(single_vuln.text.encode()),
vuln.id + source_repo.extension)
Expand Down

0 comments on commit e814468

Please sign in to comment.