Documentation
¶
Index ¶
- func DeduplicateReviewers(reviewers []string) []string
- func FilterCurrentUser(reviewers []string, currentUser string) []string
- func FindCodeownersFile(repoPath string) (string, error)
- func GetChangedFiles(repo *git.Repository, baseBranch, headBranch string) ([]string, error)
- func GetStackAwareReviewers(repo *git.Repository, co *CodeOwners, ...) ([]string, error)
- func HasCodeowners(repoPath string) bool
- func ValidateOwner(owner string) bool
- type CodeOwners
- type Owner
- type Rule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeduplicateReviewers ¶
DeduplicateReviewers removes duplicate reviewers from a list
func FilterCurrentUser ¶
FilterCurrentUser removes the current user from the reviewers list
func FindCodeownersFile ¶
FindCodeownersFile searches for CODEOWNERS file in standard locations
func GetChangedFiles ¶
func GetChangedFiles(repo *git.Repository, baseBranch, headBranch string) ([]string, error)
GetChangedFiles returns the list of files changed between base and head
func GetStackAwareReviewers ¶
func GetStackAwareReviewers(repo *git.Repository, co *CodeOwners, currentBranch, baseBranch, trunkBranch, currentUser string, considerFullStack bool) ([]string, error)
GetStackAwareReviewers returns reviewers considering the entire stack or just current PR When considerFullStack is true, it suggests reviewers for all files changed in the stack When false, it only considers files changed in the current PR
func HasCodeowners ¶
HasCodeowners checks if a CODEOWNERS file exists
func ValidateOwner ¶
ValidateOwner checks if an owner string is valid
Types ¶
type CodeOwners ¶
CodeOwners represents a parsed CODEOWNERS file
func ParseCodeowners ¶
func ParseCodeowners(repoPath string) (*CodeOwners, error)
ParseCodeowners reads and parses a CODEOWNERS file
func (*CodeOwners) GetOwnersForFile ¶
func (co *CodeOwners) GetOwnersForFile(filePath string) []Owner
GetOwnersForFile returns the owners for a specific file
func (*CodeOwners) GetReviewers ¶
func (co *CodeOwners) GetReviewers(changedFiles []string, currentUser string) []string
GetReviewers returns suggested reviewers for the given changed files