2
0
ianedwards 2 жил өмнө
parent
commit
17b156aaf4

+ 12 - 1
api/server/handlers/porter_app/report_status.go

@@ -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{}
 
@@ -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,
 	})
@@ -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 {

+ 1 - 1
dashboard/src/main/home/app-dashboard/new-app-flow/utils.ts

@@ -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 }}`;
 };

+ 1 - 1
internal/integrations/ci/actions/steps.go

@@ -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,
 	}