Ian Edwards пре 2 година
родитељ
комит
e08b46369e
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      api/server/handlers/webhook/app_v2_github.go

+ 3 - 0
api/server/handlers/webhook/app_v2_github.go

@@ -18,11 +18,13 @@ import (
 	"github.com/porter-dev/porter/internal/telemetry"
 )
 
+// GithubWebhookHandler handles webhooks sent to /api/webhooks/github/{project_id}/{cluster_id}/{porter_app_name}
 type GithubWebhookHandler struct {
 	handlers.PorterHandlerReadWriter
 	authz.KubernetesAgentGetter
 }
 
+// NewGithubWebhookHandler returns a GithubWebhookHandler
 func NewGithubWebhookHandler(
 	config *config.Config,
 	decoderValidator shared.RequestDecoderValidator,
@@ -34,6 +36,7 @@ func NewGithubWebhookHandler(
 	}
 }
 
+// ServeHTTP handles the webhook and deletes the deployment target if a PR has been closed
 func (c *GithubWebhookHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
 	ctx, span := telemetry.NewSpan(r.Context(), "serve-github-webhook")
 	defer span.End()