Documentation
¶
Index ¶
- Constants
- func CreateFeedbackMarker(entries []FeedbackEntry) string
- func StripFeedbackMarker(body string) string
- type FeedbackEntry
- type FeedbackStats
- type FeedbackType
- type IssueStats
- type RepoStats
- type Tracker
- func (t *Tracker) GetLearnings() string
- func (t *Tracker) GetStats() *FeedbackStats
- func (t *Tracker) LoadFromBody(body string)
- func (t *Tracker) RecordAcceptance(commentHash, filePath string, line int, issueType string, critical bool)
- func (t *Tracker) RecordDismissal(commentHash, filePath string, line int, issueType string, reason string)
- func (t *Tracker) RecordFeedback(entry FeedbackEntry)
- func (t *Tracker) RecordReaction(commentHash string, isPositive bool)
- func (t *Tracker) RecordResolution(commentHash, filePath string, line int, issueType string)
Constants ¶
const FeedbackMarker = "<!-- manque-feedback:"
FeedbackMarker is the HTML comment marker for storing feedback in PR body
Variables ¶
This section is empty.
Functions ¶
func CreateFeedbackMarker ¶
func CreateFeedbackMarker(entries []FeedbackEntry) string
CreateFeedbackMarker creates the HTML comment with feedback data
func StripFeedbackMarker ¶
StripFeedbackMarker removes the feedback marker from a PR body
Types ¶
type FeedbackEntry ¶
type FeedbackEntry struct {
CommentHash string `json:"comment_hash"`
Type FeedbackType `json:"type"`
Repository string `json:"repository"`
PRNumber int `json:"pr_number"`
FilePath string `json:"file_path"`
Line int `json:"line"`
IssueType string `json:"issue_type"` // bug, security, style, etc.
IsCritical bool `json:"is_critical"`
RecordedAt time.Time `json:"recorded_at"`
UserComment string `json:"user_comment,omitempty"` // Optional user explanation
}
FeedbackEntry represents a single feedback entry
func ExtractFeedbackFromBody ¶
func ExtractFeedbackFromBody(body string) []FeedbackEntry
ExtractFeedbackFromBody extracts feedback data from a PR body
type FeedbackStats ¶
type FeedbackStats struct {
TotalComments int `json:"total_comments"`
AcceptedCount int `json:"accepted_count"`
DismissedCount int `json:"dismissed_count"`
ResolvedCount int `json:"resolved_count"`
IgnoredCount int `json:"ignored_count"`
AcceptanceRate float64 `json:"acceptance_rate"`
ByIssueType map[string]IssueStats `json:"by_issue_type"`
ByRepository map[string]RepoStats `json:"by_repository"`
CommonDismissals []string `json:"common_dismissals"`
UpdatedAt time.Time `json:"updated_at"`
}
FeedbackStats represents aggregated feedback statistics
type FeedbackType ¶
type FeedbackType string
FeedbackType represents the type of feedback
const ( FeedbackAccepted FeedbackType = "accepted" // Suggestion was applied FeedbackDismissed FeedbackType = "dismissed" // User dismissed the issue FeedbackResolved FeedbackType = "resolved" // Issue was fixed FeedbackThumbsUp FeedbackType = "thumbs_up" // User liked the comment FeedbackThumbsDown FeedbackType = "thumbs_down" // User disliked the comment FeedbackModified FeedbackType = "modified" // User modified the suggestion FeedbackIgnored FeedbackType = "ignored" // User didn't act on it )
type IssueStats ¶
type IssueStats struct {
Total int `json:"total"`
Accepted int `json:"accepted"`
Dismissed int `json:"dismissed"`
AcceptanceRate float64 `json:"acceptance_rate"`
}
IssueStats represents stats for a specific issue type
type RepoStats ¶
type RepoStats struct {
Total int `json:"total"`
Accepted int `json:"accepted"`
Dismissed int `json:"dismissed"`
AcceptanceRate float64 `json:"acceptance_rate"`
}
RepoStats represents stats for a specific repository
type Tracker ¶
type Tracker struct {
Repository string
PRNumber int
Entries []FeedbackEntry
}
Tracker manages feedback collection and storage
func NewTracker ¶
NewTracker creates a new feedback tracker
func (*Tracker) GetLearnings ¶
GetLearnings generates insights from the feedback for improving reviews
func (*Tracker) GetStats ¶
func (t *Tracker) GetStats() *FeedbackStats
GetStats computes statistics from recorded feedback
func (*Tracker) LoadFromBody ¶
LoadFromBody loads existing feedback from PR body and adds to tracker
func (*Tracker) RecordAcceptance ¶
func (t *Tracker) RecordAcceptance(commentHash, filePath string, line int, issueType string, critical bool)
RecordAcceptance records that a suggestion was accepted
func (*Tracker) RecordDismissal ¶
func (t *Tracker) RecordDismissal(commentHash, filePath string, line int, issueType string, reason string)
RecordDismissal records that an issue was dismissed
func (*Tracker) RecordFeedback ¶
func (t *Tracker) RecordFeedback(entry FeedbackEntry)
RecordFeedback records a new feedback entry
func (*Tracker) RecordReaction ¶
RecordReaction records a thumbs up/down reaction