Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GitHub format package_url and correlator #961

Merged
merged 1 commit into from
Apr 15, 2022
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
2 changes: 1 addition & 1 deletion internal/formats/github/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func toGithubManifests(s *sbom.SBOM) Manifests {

name := dependencyName(p)
manifest.Resolved[name] = DependencyNode{
Purl: p.PURL,
PackageURL: p.PURL,
Metadata: toDependencyMetadata(p),
Relationship: toDependencyRelationshipType(p),
Scope: toDependencyScope(p),
Expand Down
6 changes: 3 additions & 3 deletions internal/formats/github/encoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ func Test_toGithubModel(t *testing.T) {
},
Resolved: DependencyGraph{
"pkg:generic/pkg-1@1.0.1": DependencyNode{
Purl: "pkg:generic/pkg-1@1.0.1",
PackageURL: "pkg:generic/pkg-1@1.0.1",
Scope: DependencyScopeRuntime,
Relationship: DependencyRelationshipDirect,
},
"pkg:generic/pkg-2@2.0.2": DependencyNode{
Purl: "pkg:generic/pkg-2@2.0.2",
PackageURL: "pkg:generic/pkg-2@2.0.2",
Scope: DependencyScopeRuntime,
Relationship: DependencyRelationshipDirect,
},
Expand All @@ -125,7 +125,7 @@ func Test_toGithubModel(t *testing.T) {
},
Resolved: DependencyGraph{
"pkg:generic/pkg-3@3.0.3": DependencyNode{
Purl: "pkg:generic/pkg-3@3.0.3",
PackageURL: "pkg:generic/pkg-3@3.0.3",
Scope: DependencyScopeRuntime,
Relationship: DependencyRelationshipDirect,
},
Expand Down
8 changes: 4 additions & 4 deletions internal/formats/github/github_dependency_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ type DependencySnapshot struct {
}

type Job struct {
Name string `json:"name,omitempty"` // !omitempty
ID string `json:"id,omitempty"` // !omitempty
HTMLURL string `json:"html_url,omitempty"`
Correlator string `json:"correlator,omitempty"` // !omitempty
ID string `json:"id,omitempty"` // !omitempty
HTMLURL string `json:"html_url,omitempty"`
}

type DetectorMetadata struct {
Expand Down Expand Up @@ -62,7 +62,7 @@ const (
)

type DependencyNode struct {
Purl string `json:"purl,omitempty"`
PackageURL string `json:"package_url,omitempty"`
Metadata Metadata `json:"metadata,omitempty"`
Relationship DependencyRelationship `json:"relationship,omitempty"`
Scope DependencyScope `json:"scope,omitempty"`
Expand Down