Skip to content

Commit

Permalink
Xray SCA scan - always show results with location on Sarif output (jf…
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored and gailazar300 committed Nov 19, 2023
1 parent ffb72f8 commit 3ef3bad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion xray/utils/resultwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func getXrayIssueLocationIfValidExists(tech coreutils.Technology, run *sarif.Run
return
}
if strings.TrimSpace(descriptorPath) == "" {
return
descriptorPath = "Package Descriptor"
}
return sarif.NewLocation().WithPhysicalLocation(sarif.NewPhysicalLocation().WithArtifactLocation(sarif.NewArtifactLocation().WithUri("file://" + descriptorPath))), nil
}
Expand Down
2 changes: 1 addition & 1 deletion xray/utils/resultwriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestGetXrayIssueLocationIfValidExists(t *testing.T) {
name: "No descriptor information",
tech: coreutils.Pip,
run: CreateRunWithDummyResults().WithInvocations([]*sarif.Invocation{invocation}),
expectedOutput: nil,
expectedOutput: sarif.NewLocation().WithPhysicalLocation(sarif.NewPhysicalLocation().WithArtifactLocation(sarif.NewArtifactLocation().WithUri("file://Package Descriptor"))),
},
{
name: "One descriptor information",
Expand Down

0 comments on commit 3ef3bad

Please sign in to comment.