Skip to content

Commit

Permalink
chore(frontend): improve frontend vuln debuggability (#2701)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
andrewpollock authored Oct 4, 2024
1 parent 1207cb4 commit fe16186
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gcp/appengine/frontend_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fe16186

Please sign in to comment.