fix. harden Go review flow
ci / test (pull_request) Successful in 21s
ci / publish (pull_request) Has been skipped

Fix runner bootstrap and auth handling, preserve queued SHAs, make event/job acceptance atomic, fence stale runs, correct retries and prompts, add fake end-to-end coverage, and fix deployment defaults.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Space-Banane
2026-07-12 22:20:48 +02:00
parent f19b271642
commit 85c0e735dc
19 changed files with 539 additions and 142 deletions
+18
View File
@@ -35,6 +35,24 @@ func TestResultValidationAndFormatting(t *testing.T) {
t.Fatalf("missing formatted details: %s", body)
}
}
func TestBuildPromptUsesGenericIntentForBareReview(t *testing.T) {
prompt := BuildPrompt(domain.ParsedCommand{Name: "review", Raw: "@codex review", Mode: "summary"}, domain.DefaultRepoReviewConfig(), domain.PullRequestContext{BaseSHA: "base", HeadSHA: "head"})
if contains(prompt, "review: review\n") || !contains(prompt, "review: review this pull request and report introduced issues.") {
t.Fatalf("unexpected bare-review prompt: %s", prompt)
}
}
func TestMarkdownCommentIncludesStructuredSummaryAndSuggestion(t *testing.T) {
suggestion := "Use a checked conversion."
result := domain.ReviewResult{Verdict: "has_issues", Confidence: .8, Summary: "Summary", MarkdownComment: "Primary markdown", Findings: []domain.Finding{{Severity: "medium", File: "x.go", LineStart: 2, LineEnd: 2, Title: "Issue", Body: "Details", Suggestion: &suggestion}}}
body := FormatResultComment("head", result, true)
for _, part := range []string{"Structured Findings", "Verdict: `has_issues`", "Summary", "Use a checked conversion."} {
if !contains(body, part) {
t.Fatalf("formatted comment missing %q: %s", part, body)
}
}
}
func contains(s, needle string) bool {
for i := 0; i+len(needle) <= len(s); i++ {
if s[i:i+len(needle)] == needle {