all: update YAML versions to closely match OSV versions
Instead of storing version ranges as structs with paired
Introduced/Fixed versions, follow the OSV convention of
considering each version as its own object with an associated
type.
This simplifies operations such as sorting and merging version
lists, making it easier for us to improve automation.
The only effect on the user (vulndb maintainer) is that the
YAML syntax is now:
- introduced: xxx
- fixed: xxx
instead of
- introduced: xxx
fixed: xxx
As a convenience, however, the old format is still accepted for
writing reports. (However, it will be automatically converted to the
new format when vulnreport fix is run).
A follow up CL will make this change for all existing YAML reports.
This will NOT affect the published OSV files.
Change-Id: I91c524b311be5230db5d382f77de4a8e0cd1dda7
Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/593820
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/all_test.go b/all_test.go
index 7895529..65917f9 100644
--- a/all_test.go
+++ b/all_test.go
@@ -128,7 +128,10 @@
}
// Check that a correct OSV file was generated for each YAML report.
if r.Excluded == "" {
- generated := r.ToOSV(time.Time{})
+ generated, err := r.ToOSV(time.Time{})
+ if err != nil {
+ t.Fatal(err)
+ }
osvFilename := r.OSVFilename()
current, err := report.ReadOSV(osvFilename)
if err != nil {