Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions gcp/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,17 +1032,16 @@ def _match_versions(version: str, affected: osv.AffectedVersions) -> bool:
# does cause an error, just match nothing.
try:
parsed_version = ecosystem_helper.sort_key(version)
except:
# TODO(michaelkedar): This log is noisy.
logging.error('Ecosystem helper for %s raised an exception',
except Exception:
logging.debug('Ecosystem helper for %s raised an exception',
affected.ecosystem)
return False

for v in affected.versions:
try:
if ecosystem_helper.sort_key(v) == parsed_version:
return True
except:
except Exception:
logging.error('Version %s in AffectedVersion %s (%s) does not parse', v,
affected.key, affected.vuln_id)
return False
Expand Down Expand Up @@ -1079,17 +1078,16 @@ def _match_events(version: str, affected: osv.AffectedVersions) -> bool:
return False
try:
parsed_version = ecosystem_helper.sort_key(version)
except:
# TODO(michaelkedar): This log is noisy.
logging.error('Ecosystem helper for %s raised an exception',
except Exception:
logging.debug('Ecosystem helper for %s raised an exception',
affected.ecosystem)
return False

# Find where this version would belong in the sorted events list.
for event in reversed(affected.events):
try:
event_ver = ecosystem_helper.sort_key(event.value)
except:
except Exception:
# Shouldn't really happen. We use sort_key to sort these before creating
# the AffectedVersions entity.
logging.error('Event %s in AffectedVersion %s (%s) does not parse',
Expand Down
1 change: 0 additions & 1 deletion gcp/website/frontend_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ def add_source_info(response: dict):
if source_repo.human_link:
ecosystem_version = ''
if source.startswith('almalinux'):
source_path: str
splits = source_path.split('/')
if len(splits) >= 2:
ecosystem_version = splits[1].removeprefix('almalinux')
Expand Down
Loading