Repository: google/osv.dev

Issue:
add ARTICLE reference link type to protobuf file for osv lib
Some of the advisories in the [Python Packaging Advisory Database](https://github.com/pypa/advisory-db) are failing to analyze due to an error like the below:

```
google.protobuf.json_format.ParseError: Failed to parse type field: Invalid enum value ARTICLE for enum type osv.Reference.Type.
```

According to the most recent [spec](https://ossf.github.io/osv-schema/#references-field), `ARTICLE` should be a valid type for a reference link.

It looks like [vulnerability.proto](https://github.com/google/osv/blob/12e0175b9303f6ecca1ad8abdb3a28b3c97e7b54/lib/osv/vulnerability.proto#L167) just needs to be updated and regenerated?



Discussion:

Resolving patch:
diff --git a/lib/osv/vulnerability_pb2.py b/lib/osv/vulnerability_pb2.py
--- a/lib/osv/vulnerability_pb2.py
+++ b/lib/osv/vulnerability_pb2.py
@@ -22,7 +22,7 @@
   syntax='proto3',
   serialized_options=None,
   create_key=_descriptor._internal_create_key,
-  serialized_pb=b'\n\x17osv/vulnerability.proto\x12\x03osv\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"y\n\x06\x43ommit\x12\'\n\trepo_type\x18\x01 \x01(\x0e\x32\x14.osv.Commit.RepoType\x12\x10\n\x08repo_url\x18\x02 \x01(\t\x12\x0e\n\x06\x63ommit\x18\x03 \x01(\t\"$\n\x08RepoType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\"8\n\x07Package\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tecosystem\x18\x02 \x01(\t\x12\x0c\n\x04purl\x18\x03 \x01(\t\"\xa4\x01\n\rAffectedRange\x12%\n\x04type\x18\x01 \x01(\x0e\x32\x17.osv.AffectedRange.Type\x12\x0c\n\x04repo\x18\x02 \x01(\t\x12\x12\n\nintroduced\x18\x03 \x01(\t\x12\r\n\x05\x66ixed\x18\x04 \x01(\t\";\n\x04Type\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\x12\n\n\x06SEMVER\x10\x02\x12\r\n\tECOSYSTEM\x10\x03\"?\n\x07\x41\x66\x66\x65\x63ts\x12\"\n\x06ranges\x18\x01 \x03(\x0b\x32\x12.osv.AffectedRange\x12\x10\n\x08versions\x18\x02 \x03(\t\"9\n\x05\x45vent\x12\x12\n\nintroduced\x18\x01 \x01(\t\x12\r\n\x05\x66ixed\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\t\"\x8d\x01\n\x05Range\x12\x1d\n\x04type\x18\x01 \x01(\x0e\x32\x0f.osv.Range.Type\x12\x0c\n\x04repo\x18\x02 \x01(\t\x12\x1a\n\x06\x65vents\x18\x03 \x03(\x0b\x32\n.osv.Event\";\n\x04Type\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\x12\n\n\x06SEMVER\x10\x02\x12\r\n\tECOSYSTEM\x10\x03\"\xc0\x01\n\x08\x41\x66\x66\x65\x63ted\x12\x1d\n\x07package\x18\x01 \x01(\x0b\x32\x0c.osv.Package\x12\x1a\n\x06ranges\x18\x02 \x03(\x0b\x32\n.osv.Range\x12\x10\n\x08versions\x18\x03 \x03(\t\x12\x33\n\x12\x65\x63osystem_specific\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x32\n\x11\x64\x61tabase_specific\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x86\x01\n\tReference\x12!\n\x04type\x18\x01 \x01(\x0e\x32\x13.osv.Reference.Type\x12\x0b\n\x03url\x18\x02 \x01(\t\"I\n\x04Type\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0c\n\x08\x41\x44VISORY\x10\x02\x12\n\n\x06REPORT\x10\x03\x12\x07\n\x03\x46IX\x10\x04\x12\x0b\n\x07PACKAGE\x10\x05\"\xf8\x03\n\rVulnerability\x12\n\n\x02id\x18\x01 \x01(\t\x12-\n\tpublished\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08modified\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\twithdrawn\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x61liases\x18\x08 \x03(\t\x12\x0f\n\x07related\x18\r \x03(\t\x12\x1d\n\x07package\x18\x02 \x01(\x0b\x32\x0c.osv.Package\x12\x0f\n\x07summary\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x04 \x01(\t\x12\x1d\n\x07\x61\x66\x66\x65\x63ts\x18\x06 \x01(\x0b\x32\x0c.osv.Affects\x12\x1f\n\x08\x61\x66\x66\x65\x63ted\x18\x11 \x03(\x0b\x32\r.osv.Affected\x12\"\n\nreferences\x18\x10 \x03(\x0b\x32\x0e.osv.Reference\x12\x33\n\x12\x65\x63osystem_specific\x18\x0e \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x32\n\x11\x64\x61tabase_specific\x18\x0f \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1f\n\x08severity\x18\x05 \x01(\x0e\x32\r.osv.Severity*A\n\x08Severity\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\x62\x06proto3'
+  serialized_pb=b'\n\x17osv/vulnerability.proto\x12\x03osv\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"y\n\x06\x43ommit\x12\'\n\trepo_type\x18\x01 \x01(\x0e\x32\x14.osv.Commit.RepoType\x12\x10\n\x08repo_url\x18\x02 \x01(\t\x12\x0e\n\x06\x63ommit\x18\x03 \x01(\t\"$\n\x08RepoType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\"8\n\x07Package\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tecosystem\x18\x02 \x01(\t\x12\x0c\n\x04purl\x18\x03 \x01(\t\"\xa4\x01\n\rAffectedRange\x12%\n\x04type\x18\x01 \x01(\x0e\x32\x17.osv.AffectedRange.Type\x12\x0c\n\x04repo\x18\x02 \x01(\t\x12\x12\n\nintroduced\x18\x03 \x01(\t\x12\r\n\x05\x66ixed\x18\x04 \x01(\t\";\n\x04Type\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\x12\n\n\x06SEMVER\x10\x02\x12\r\n\tECOSYSTEM\x10\x03\"?\n\x07\x41\x66\x66\x65\x63ts\x12\"\n\x06ranges\x18\x01 \x03(\x0b\x32\x12.osv.AffectedRange\x12\x10\n\x08versions\x18\x02 \x03(\t\"9\n\x05\x45vent\x12\x12\n\nintroduced\x18\x01 \x01(\t\x12\r\n\x05\x66ixed\x18\x02 \x01(\t\x12\r\n\x05limit\x18\x03 \x01(\t\"\x8d\x01\n\x05Range\x12\x1d\n\x04type\x18\x01 \x01(\x0e\x32\x0f.osv.Range.Type\x12\x0c\n\x04repo\x18\x02 \x01(\t\x12\x1a\n\x06\x65vents\x18\x03 \x03(\x0b\x32\n.osv.Event\";\n\x04Type\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x07\n\x03GIT\x10\x01\x12\n\n\x06SEMVER\x10\x02\x12\r\n\tECOSYSTEM\x10\x03\"\xc0\x01\n\x08\x41\x66\x66\x65\x63ted\x12\x1d\n\x07package\x18\x01 \x01(\x0b\x32\x0c.osv.Package\x12\x1a\n\x06ranges\x18\x02 \x03(\x0b\x32\n.osv.Range\x12\x10\n\x08versions\x18\x03 \x03(\t\x12\x33\n\x12\x65\x63osystem_specific\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x32\n\x11\x64\x61tabase_specific\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x93\x01\n\tReference\x12!\n\x04type\x18\x01 \x01(\x0e\x32\x13.osv.Reference.Type\x12\x0b\n\x03url\x18\x02 \x01(\t\"V\n\x04Type\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0c\n\x08\x41\x44VISORY\x10\x02\x12\n\n\x06REPORT\x10\x03\x12\x07\n\x03\x46IX\x10\x04\x12\x0b\n\x07PACKAGE\x10\x05\x12\x0b\n\x07\x41RTICLE\x10\x06\"\xf8\x03\n\rVulnerability\x12\n\n\x02id\x18\x01 \x01(\t\x12-\n\tpublished\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08modified\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\twithdrawn\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x61liases\x18\x08 \x03(\t\x12\x0f\n\x07related\x18\r \x03(\t\x12\x1d\n\x07package\x18\x02 \x01(\x0b\x32\x0c.osv.Package\x12\x0f\n\x07summary\x18\x03 \x01(\t\x12\x0f\n\x07\x64\x65tails\x18\x04 \x01(\t\x12\x1d\n\x07\x61\x66\x66\x65\x63ts\x18\x06 \x01(\x0b\x32\x0c.osv.Affects\x12\x1f\n\x08\x61\x66\x66\x65\x63ted\x18\x11 \x03(\x0b\x32\r.osv.Affected\x12\"\n\nreferences\x18\x10 \x03(\x0b\x32\x0e.osv.Reference\x12\x33\n\x12\x65\x63osystem_specific\x18\x0e \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x32\n\x11\x64\x61tabase_specific\x18\x0f \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1f\n\x08severity\x18\x05 \x01(\x0e\x32\r.osv.Severity*A\n\x08Severity\x12\x08\n\x04NONE\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x12\x0c\n\x08\x43RITICAL\x10\x04\x62\x06proto3'
   ,
   dependencies=[google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,])
 
@@ -61,8 +61,8 @@
   ],
   containing_type=None,
   serialized_options=None,
-  serialized_start=1550,
-  serialized_end=1615,
+  serialized_start=1563,
+  serialized_end=1628,
 )
 _sym_db.RegisterEnumDescriptor(_SEVERITY)
 
@@ -206,11 +206,16 @@
       serialized_options=None,
       type=None,
       create_key=_descriptor._internal_create_key),
+    _descriptor.EnumValueDescriptor(
+      name='ARTICLE', index=6, number=6,
+      serialized_options=None,
+      type=None,
+      create_key=_descriptor._internal_create_key),
   ],
   containing_type=None,
   serialized_options=None,
   serialized_start=968,
-  serialized_end=1041,
+  serialized_end=1054,
 )
 _sym_db.RegisterEnumDescriptor(_REFERENCE_TYPE)
 
@@ -590,7 +595,7 @@
   oneofs=[
   ],
   serialized_start=907,
-  serialized_end=1041,
+  serialized_end=1054,
 )
 
 
@@ -719,8 +724,8 @@
   extension_ranges=[],
   oneofs=[
   ],
-  serialized_start=1044,
-  serialized_end=1548,
+  serialized_start=1057,
+  serialized_end=1561,
 )
 
 _COMMIT.fields_by_name['repo_type'].enum_type = _COMMIT_REPOTYPE


Test patch: