Skip to content

Commit

Permalink
Use new path for trusty package URLs (#4567)
Browse files Browse the repository at this point in the history
`/report` was prepended to the path, this reflects that.

Signed-off-by: Juan Antonio Osorio <[email protected]>
  • Loading branch information
JAORMX authored Sep 21, 2024
1 parent 68d91f6 commit 9f9c6d3
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions internal/engine/eval/trusty/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,15 +290,21 @@ func (sph *summaryPrHandler) generateSummary() (string, error) {
if alternative.trustyReply.Summary.Score != nil {
score = *alternative.trustyReply.Summary.Score
}

packageUIURL, err := url.JoinPath(
constants.TrustyHttpURL,
"report",
strings.ToLower(alternative.Dependency.Ecosystem.AsString()),
url.PathEscape(alternative.Dependency.Name))
if err != nil {
// This is unlikely to happen, but if it does, we skip the package
continue
}
packageData := templatePackageData{
Ecosystem: alternative.Dependency.Ecosystem.AsString(),
PackageName: alternative.Dependency.Name,
TrustyURL: fmt.Sprintf(
"%s%s/%s", constants.TrustyHttpURL,
strings.ToLower(alternative.Dependency.Ecosystem.AsString()),
url.PathEscape(alternative.trustyReply.PackageName),
),
Score: score,
TrustyURL: packageUIURL,
Score: score,
}

// If the package is malicious we list it separately
Expand Down

0 comments on commit 9f9c6d3

Please sign in to comment.