feat: load personas from target repo .review-bot/personas/
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 9m32s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 10m10s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 10m51s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 10m33s
PR Ready Gate / clear-labels (pull_request) Successful in 2s
CI / test (pull_request) Successful in 9m32s
CI / review (anthropic--claude-4.6-sonnet, sonnet, SONNET_REVIEW_TOKEN) (pull_request) Successful in 10m10s
CI / review (gpt-5, gpt, GPT_REVIEW_TOKEN) (pull_request) Successful in 10m51s
CI / review (gpt-5, security, SECURITY_REVIEW.md, SECURITY_REVIEW_TOKEN) (pull_request) Successful in 10m33s
Implements #60. - Add ParsePersonaBytes() for parsing personas from byte data - Add LoadRepoPersonas() to fetch personas from repo via Gitea API - Add MergePersonas() to combine built-in and repo personas - Add GetBuiltinPersonasMap() helper - Update main.go to load repo personas first, fall back to built-in - Add giteaClientAdapter to bridge gitea.Client to review.GiteaClient When --persona is specified, the bot now: 1. Attempts to fetch personas from .review-bot/personas/*.yaml 2. If the named persona exists in the repo, uses it 3. Otherwise falls back to built-in personas This allows repos to define domain-specific personas (e.g., trading experts for gargoyle, crypto experts for kms-lite) without modifying the review-bot codebase.
This commit is contained in:
@@ -224,6 +224,13 @@ func checkYAMLDepth(node *yaml.Node, depth, maxDepth, maxNodes int, seen map[*ya
|
||||
return nil
|
||||
}
|
||||
|
||||
// ParsePersonaBytes parses persona data from bytes with a source label for errors.
|
||||
// This is useful for parsing personas fetched from external sources (e.g., Gitea API)
|
||||
// without requiring filesystem access. Format is detected by source extension.
|
||||
func ParsePersonaBytes(data []byte, source string) (*Persona, error) {
|
||||
return parsePersona(data, source)
|
||||
}
|
||||
|
||||
func validatePersona(p *Persona, source string) error {
|
||||
if p.Name == "" {
|
||||
return fmt.Errorf("persona %s: name is required", source)
|
||||
|
||||
Reference in New Issue
Block a user