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
3 changes: 2 additions & 1 deletion internal/ihop/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type LegacySBOMPackage struct {
Version string `json:"version"`
Arch string `json:"arch"`
Source *LegacySBOMPackageSource `json:"source,omitempty"`
Summary string `json:"summary,omitempty"`
}

// LegacySBOMPackageSource represents a package source as defined in the legacy
Expand Down Expand Up @@ -98,7 +99,7 @@ func (s SBOM) LegacyFormat() (string, error) {
Version: metadata.SourceVersion,
UpstreamVersion: upstreamVersion,
},
// TODO: Summary
Summary: strings.SplitN(metadata.Description, "\n", 2)[0],
})

case pkg.ApkMetadata:
Expand Down
4 changes: 3 additions & 1 deletion internal/ihop/sbom_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func testSBOM(t *testing.T, context spec.G, it spec.S) {
Architecture: "arm64",
Source: "c-package-source",
SourceVersion: "3.1.2-upstream-ubuntu3",
Description: "a package for c\n provides a bunch of c stuff",
},
},
pkg.Package{
Expand Down Expand Up @@ -103,7 +104,8 @@ func testSBOM(t *testing.T, context spec.G, it spec.S) {
"name": "c-package-source",
"version": "3.1.2-upstream-ubuntu3",
"upstreamVersion": "3.1.2-upstream"
}
},
"summary": "a package for c"
}
]`))
})
Expand Down