feat(ai): PR review service (services/ai/review.go) #365

Open
opened 2026-05-31 16:28:34 +00:00 by jmiller · 0 comments
Owner

Summary

Built-in PR review service that triggers on PR open/push and posts smart comments from mokogitea-claude[bot].

Parent Issue

#359

Behavior

  1. PR opened or new commits pushed
  2. If repo has AI enabled and auto_review=true:
    • Fetch the diff
    • Read .mokogitea/CLAUDE.md for project rules
    • Send to Claude with review prompt
    • Post summary comment
    • Post inline review comments with suggestions
    • Apply risk label if configured

Comment Types

  • Summary: what the PR does, key changes, risk areas
  • Inline reviews: bugs, security, performance, style (using Gitea suggestion blocks)
  • Risk labels: review: low-risk / review: needs-attention / review: security-concern

Strictness Levels

  • minimal: only critical bugs and security
  • standard: bugs, security, performance, major style
  • thorough: everything including suggestions and readability

Implementation

  • services/ai/review.go
  • services/ai/prompt.go
  • services/ai/comment.go
  • Hooks into notify service (same pattern as Actions)
  • Debounce: wait 30s after last push
  • Skip draft PRs unless requested

Dependencies

  • AI settings schema
  • #362 (mokogitea-claude[bot])
## Summary Built-in PR review service that triggers on PR open/push and posts smart comments from mokogitea-claude[bot]. ## Parent Issue #359 ## Behavior 1. PR opened or new commits pushed 2. If repo has AI enabled and auto_review=true: - Fetch the diff - Read .mokogitea/CLAUDE.md for project rules - Send to Claude with review prompt - Post summary comment - Post inline review comments with suggestions - Apply risk label if configured ## Comment Types - **Summary**: what the PR does, key changes, risk areas - **Inline reviews**: bugs, security, performance, style (using Gitea suggestion blocks) - **Risk labels**: review: low-risk / review: needs-attention / review: security-concern ## Strictness Levels - minimal: only critical bugs and security - standard: bugs, security, performance, major style - thorough: everything including suggestions and readability ## Implementation - services/ai/review.go - services/ai/prompt.go - services/ai/comment.go - Hooks into notify service (same pattern as Actions) - Debounce: wait 30s after last push - Skip draft PRs unless requested ## Dependencies - AI settings schema - #362 (mokogitea-claude[bot])
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#365