Skip to content

Commit

Permalink
Update GitHub format package_url and correlator (anchore#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzantow authored Apr 15, 2022
1 parent b7295b7 commit 248023b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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

0 comments on commit 248023b

Please sign in to comment.