From fe16186f0dfb5a5d0ef27468779c11295576fddd Mon Sep 17 00:00:00 2001 From: Andrew Pollock Date: Fri, 4 Oct 2024 11:49:24 +1000 Subject: [PATCH] chore(frontend): improve frontend vuln debuggability (#2701) I hit weirdness with an incomplete vulnerability page, which took longer than I'd have liked to get to the bottom of. It was because the source `redhat-stage` was renamed to `redhat` AND the particular record I was looking at had failed to import successfully from the newly named `redhat` source. This scenario is unexpected enough that it shouldn't be something that happens silently. --- gcp/appengine/frontend_handlers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcp/appengine/frontend_handlers.py b/gcp/appengine/frontend_handlers.py index cced4cc27b9..38c8e3d8147 100644 --- a/gcp/appengine/frontend_handlers.py +++ b/gcp/appengine/frontend_handlers.py @@ -380,13 +380,16 @@ def add_links(bug): def add_source_info(bug, response): - """Add source information to `response`.""" + """Add upstream provenance information to `response`.""" if bug.source_of_truth == osv.SourceOfTruth.INTERNAL: response['source'] = 'INTERNAL' return source_repo = osv.get_source_repository(bug.source) if not source_repo or not source_repo.link: + logging.error( + 'Unexpected state for "%s": source repository/link not found for "%s"', + bug.id, bug.source) return source_path = osv.source_path(source_repo, bug)