diff --git a/internal/constants/prod.go b/internal/constants/prod.go index cc0390c35d..cdee205718 100644 --- a/internal/constants/prod.go +++ b/internal/constants/prod.go @@ -22,4 +22,6 @@ const ( IdentitySeverURL = "https://auth.stacklok.com" // MinderGRPCHost is the host of the minder gRPC server MinderGRPCHost = "api.stacklok.com" + // TrustyHttpURL is the URL of the trusty server + TrustyHttpURL = "https://trustypkg.dev/" ) diff --git a/internal/constants/staging.go b/internal/constants/staging.go index ce020d90d5..99cd2226f2 100644 --- a/internal/constants/staging.go +++ b/internal/constants/staging.go @@ -22,4 +22,6 @@ const ( IdentitySeverURL = "https://auth.staging.stacklok.dev" // MinderGRPCHost is the host of the minder gRPC server MinderGRPCHost = "staging.stacklok.dev" + // TrustyHttpURL is the URL of the trusty server + TrustyHttpURL = "https://app.staging.stacklok.dev/" ) diff --git a/internal/engine/eval/trusty/actions.go b/internal/engine/eval/trusty/actions.go index 14af0406e8..41e1a8f82c 100644 --- a/internal/engine/eval/trusty/actions.go +++ b/internal/engine/eval/trusty/actions.go @@ -19,10 +19,10 @@ import ( "bytes" "context" "fmt" - "net/url" "strings" "text/template" + "github.com/stacklok/minder/internal/constants" pb "github.com/stacklok/minder/pkg/api/protobuf/go/minder/v1" provifv1 "github.com/stacklok/minder/pkg/providers/v1" ) @@ -112,15 +112,6 @@ func (sph *summaryPrHandler) generateSummary() (string, error) { } summary.WriteString(headerBuf.String()) - piUrl, err := url.Parse(sph.trustyUrl) - if err != nil { - return "", fmt.Errorf("could not parse trustyUrl: %w", err) - } - appUrl := url.URL{ - Scheme: piUrl.Scheme, - Host: fmt.Sprintf("app.%s", piUrl.Host), - } - for i := range sph.trackedAlternatives { var rowBuf bytes.Buffer @@ -142,7 +133,7 @@ func (sph *summaryPrHandler) generateSummary() (string, error) { DependencyName: sph.trackedAlternatives[i].Dependency.Name, DependencyScore: sph.trackedAlternatives[i].trustyReply.Summary.Score, Alternatives: higherScoringAlternatives, - BaseUrl: appUrl.String(), + BaseUrl: constants.TrustyHttpURL, }); err != nil { return "", fmt.Errorf("could not execute template: %w", err) }