Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Config ¶
type Config struct {
Secret string
BotUserEmail string
ActionKeywords map[string]KeywordEntry
}
type KeywordAction ¶
type KeywordAction struct {
Status tasks.Status // target status
Verb string // past-tense label for comment, e.g. "Resolved"
}
KeywordAction maps a commit message keyword to a task status transition.
type KeywordEntry ¶ added in v0.14.0
type KeywordParser ¶ added in v0.14.0
type KeywordParser struct {
// contains filtered or unexported fields
}
KeywordParser holds the configured keyword-to-action mappings and a compiled regex for matching them in commit messages.
func NewKeywordParser ¶ added in v0.14.0
func NewKeywordParser(entries map[string]KeywordEntry) (*KeywordParser, error)
NewKeywordParser builds a KeywordParser from a config map of keyword entries. It validates each status and defaults the Verb to the title-cased keyword when empty. The regex is compiled from sorted keys for determinism.
func (*KeywordParser) ParseCommitMessage ¶ added in v0.14.0
func (kp *KeywordParser) ParseCommitMessage(message string) []ParsedReference
ParseCommitMessage scans a commit message for task references. Returns a list of ParsedReference, one per unique #NUMBER found. If both a keyword and bare reference exist for the same number, the keyword wins.
type ParsedReference ¶
type ParsedReference struct {
TaskNumber int
Action *KeywordAction // nil if bare #N with no keyword
CommitHash string
CommitMessage string
}
ParsedReference represents a single task reference found in a commit message.
type ProcessResult ¶
type ProcessResult struct {
Matched int `json:"matched"`
Resolved int `json:"resolved"`
Mentioned int `json:"mentioned"`
}
ProcessResult tracks the results of processing a push event.
func NewProcessResult ¶
func NewProcessResult() *ProcessResult
func (*ProcessResult) AddMatched ¶
func (r *ProcessResult) AddMatched()
func (*ProcessResult) AddMentioned ¶
func (r *ProcessResult) AddMentioned()
func (*ProcessResult) AddResolved ¶
func (r *ProcessResult) AddResolved()
type PushCommit ¶
PushCommit is a flattened commit used by the service layer.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) ProcessPushEvent ¶
func (s *Service) ProcessPushEvent( ctx context.Context, repoFullName string, commits []PushCommit, ) (*ProcessResult, error)