Skip to content

Commit

Permalink
Comment fix (#3783)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianedwards authored Oct 10, 2023
1 parent 688638e commit 17b156a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion api/server/handlers/porter_app/report_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@ func (c *ReportRevisionStatusHandler) ServeHTTP(w http.ResponseWriter, r *http.R
c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusInternalServerError))
return
}
telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "deployment-target-id", Value: deploymentTarget.ID})

telemetry.WithAttributes(span,
telemetry.AttributeKV{Key: "deployment-target-id", Value: deploymentTarget.ID},
telemetry.AttributeKV{Key: "pr-number", Value: request.PRNumber},
telemetry.AttributeKV{Key: "commit-sha", Value: request.CommitSHA},
telemetry.AttributeKV{Key: "preview", Value: deploymentTarget.Preview},
telemetry.AttributeKV{Key: "revision-number", Value: revision.RevisionNumber},
)

resp := &ReportRevisionStatusResponse{}

Expand All @@ -148,6 +155,7 @@ func (c *ReportRevisionStatusHandler) ServeHTTP(w http.ResponseWriter, r *http.R
porterApp: porterApp,
prNumber: request.PRNumber,
commitSha: request.CommitSHA,
serverURL: c.Config().ServerConf.ServerURL,
githubAppSecret: c.Config().ServerConf.GithubAppSecret,
githubAppID: c.Config().ServerConf.GithubAppID,
})
Expand Down Expand Up @@ -190,6 +198,9 @@ func writePRComment(ctx context.Context, inp writePRCommentInput) error {
if inp.githubAppID == "" {
return telemetry.Error(ctx, span, nil, "github app id is empty")
}
if inp.serverURL == "" {
return telemetry.Error(ctx, span, nil, "server url is empty")
}

client, err := porter_app.GetGithubClientByRepoID(ctx, inp.porterApp.GitRepoID, inp.githubAppSecret, inp.githubAppID)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@ jobs:
PORTER_STACK_NAME: ${stackName}
PORTER_TAG: \${{ steps.vars.outputs.sha_short }}
PORTER_TOKEN: \${{ secrets.PORTER_STACK_${projectID}_${clusterId} }}
PORTER_PR_NUMBER: \${{ github.event.inputs.pr_number }}`;
PORTER_PR_NUMBER: \${{ github.event.number }}`;
};
2 changes: 1 addition & 1 deletion internal/integrations/ci/actions/steps.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func getDeployStackStep(
"PORTER_TOKEN": fmt.Sprintf("${{ secrets.%s }}", porterTokenSecretName),
"PORTER_TAG": "${{ steps.vars.outputs.sha_short }}",
"PORTER_STACK_NAME": stackName,
"PORTER_PR_NUMBER": "${{ github.event.inputs.pr_number }}",
"PORTER_PR_NUMBER": "${{ github.event.number }}",
},
Timeout: 30,
}
Expand Down

0 comments on commit 17b156a

Please sign in to comment.