From bcd47d109aad38f93af56e60b3d572e9c50f14e1 Mon Sep 17 00:00:00 2001 From: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> Date: Tue, 14 Oct 2025 05:02:15 -0400 Subject: [PATCH] chore: schema and test additions Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com> --- internal/constants.go | 2 +- internal/packagemetadata/generated.go | 1 + .../internal/spdxutil/helpers/originator_supplier_test.go | 1 + syft/format/internal/spdxutil/helpers/source_info.go | 2 ++ syft/format/internal/spdxutil/helpers/source_info_test.go | 8 ++++++++ syft/pkg/type_test.go | 1 + 6 files changed, 14 insertions(+), 1 deletion(-) diff --git a/internal/constants.go b/internal/constants.go index 03c9318ee..16275d02f 100644 --- a/internal/constants.go +++ b/internal/constants.go @@ -3,5 +3,5 @@ package internal const ( // JSONSchemaVersion is the current schema version output by the JSON encoder // This is roughly following the "SchemaVer" guidelines for versioning the JSON schema. Please see schema/json/README.md for details on how to increment. - JSONSchemaVersion = "16.0.42" + JSONSchemaVersion = "16.0.43" ) diff --git a/internal/packagemetadata/generated.go b/internal/packagemetadata/generated.go index d718bc6e0..02d0de5fe 100644 --- a/internal/packagemetadata/generated.go +++ b/internal/packagemetadata/generated.go @@ -27,6 +27,7 @@ func AllTypes() []any { pkg.ELFBinaryPackageNoteJSONPayload{}, pkg.ElixirMixLockEntry{}, pkg.ErlangRebarLockEntry{}, + pkg.GGUFFileMetadata{}, pkg.GitHubActionsUseStatement{}, pkg.GolangBinaryBuildinfoEntry{}, pkg.GolangModuleEntry{}, diff --git a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go index d8950f4ac..1494accd2 100644 --- a/syft/format/internal/spdxutil/helpers/originator_supplier_test.go +++ b/syft/format/internal/spdxutil/helpers/originator_supplier_test.go @@ -55,6 +55,7 @@ func Test_OriginatorSupplier(t *testing.T) { pkg.OpamPackage{}, pkg.YarnLockEntry{}, pkg.TerraformLockProviderEntry{}, + pkg.GGUFFileMetadata{}, ) tests := []struct { name string diff --git a/syft/format/internal/spdxutil/helpers/source_info.go b/syft/format/internal/spdxutil/helpers/source_info.go index 5d36a600d..7c7020af1 100644 --- a/syft/format/internal/spdxutil/helpers/source_info.go +++ b/syft/format/internal/spdxutil/helpers/source_info.go @@ -82,6 +82,8 @@ func SourceInfo(p pkg.Package) string { answer = "acquired package info from Homebrew formula" case pkg.TerraformPkg: answer = "acquired package info from Terraform dependency lock file" + case pkg.ModelPkg: + answer = "acquired package info from AI artifact" default: answer = "acquired package info from the following paths" } diff --git a/syft/format/internal/spdxutil/helpers/source_info_test.go b/syft/format/internal/spdxutil/helpers/source_info_test.go index 2502dfe8c..13338f8c4 100644 --- a/syft/format/internal/spdxutil/helpers/source_info_test.go +++ b/syft/format/internal/spdxutil/helpers/source_info_test.go @@ -351,6 +351,14 @@ func Test_SourceInfo(t *testing.T) { "acquired package info from Terraform dependency lock file", }, }, + { + input: pkg.Package{ + Type: pkg.ModelPkg, + }, + expected: []string{ + "", + }, + }, } var pkgTypes []pkg.Type for _, test := range tests { diff --git a/syft/pkg/type_test.go b/syft/pkg/type_test.go index a0695b5bf..b58e4ecd5 100644 --- a/syft/pkg/type_test.go +++ b/syft/pkg/type_test.go @@ -155,6 +155,7 @@ func TestTypeFromPURL(t *testing.T) { expectedTypes.Remove(string(HomebrewPkg)) expectedTypes.Remove(string(TerraformPkg)) expectedTypes.Remove(string(GraalVMNativeImagePkg)) + expectedTypes.Remove(string(ModelPkg)) // no valid purl for ai artifacts currently expectedTypes.Remove(string(PhpPeclPkg)) // we should always consider this a pear package for _, test := range tests {