Skip to content

Commit 0472f42

Browse files
authored
fix(api): disable range-based matching for Ubuntu and Alpine (#3980)
Causing too many false positives in osv-scanner
1 parent a386f75 commit 0472f42

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gcp/api/server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,6 +1271,14 @@ def query_by_version(
12711271

12721272
is_semver = ecosystems.is_semver(ecosystem)
12731273
supports_comparing = ecosystem_info is not None
1274+
# TODO(michaelkedar): We don't support grabbing the release number from PURLs
1275+
# https://github.com/google/osv.dev/issues/3126
1276+
# This causes many false positive matches in Ubuntu and Alpine in particular
1277+
# when doing range-based matching.
1278+
# We have version enumeration for Alpine, and Ubuntu provides versions for us.
1279+
# Just skip range-based matching if they don't have release numbers for now.
1280+
if ecosystem in ('Alpine', 'Ubuntu'):
1281+
supports_comparing = False
12741282

12751283
bugs = []
12761284
if ecosystem:

0 commit comments

Comments
 (0)