summaryrefslogtreecommitdiff
path: root/internal/api/webhook.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/webhook.go')
-rw-r--r--internal/api/webhook.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/internal/api/webhook.go b/internal/api/webhook.go
index 141224f..3af4cc8 100644
--- a/internal/api/webhook.go
+++ b/internal/api/webhook.go
@@ -1,6 +1,7 @@
package api
import (
+ "context"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
@@ -184,7 +185,7 @@ func (s *Server) createCIFailureTask(w http.ResponseWriter, repoName, fullName,
htmlURL = fmt.Sprintf("https://github.com/%s/commit/%s", fullName, sha)
}
- instructions := fmt.Sprintf(
+ fallback := fmt.Sprintf(
"A CI failure has been detected and requires investigation.\n\n"+
"Repository: %s\n"+
"Branch: %s\n"+
@@ -199,6 +200,18 @@ func (s *Server) createCIFailureTask(w http.ResponseWriter, repoName, fullName,
fullName, branch, sha, checkName, htmlURL,
)
+ tctx := ciTriageContext{
+ Repo: fullName,
+ Branch: branch,
+ SHA: sha,
+ CheckName: checkName,
+ URL: htmlURL,
+ }
+ if project != nil {
+ tctx.ProjectDir = project.Dir
+ }
+ instructions := enrichCIInstructions(context.Background(), s.llm, tctx, fallback)
+
now := time.Now().UTC()
t := &task.Task{
ID: uuid.New().String(),