Documentation
¶
Index ¶
- type Condition
- func AgeCondition(l *Labeler) Condition
- func AuthorCanMergeCondition() Condition
- func AuthorCondition() Condition
- func AuthorInTeamCondition(l *Labeler) Condition
- func BaseBranchCondition() Condition
- func BodyCondition() Condition
- func BranchCondition() Condition
- func FilesCondition(l *Labeler) Condition
- func IsDraftCondition() Condition
- func IsMergeableCondition() Condition
- func LastModifiedCondition(l *Labeler) Condition
- func SizeCondition(l *Labeler) Condition
- func TitleCondition() Condition
- func TypeCondition() Condition
- type DefaultHttpClient
- type DurationConfig
- type GitHubFacade
- type HttpClient
- type LabelMatcher
- type LabelUpdates
- type Labeler
- type LabelerConfigV0
- type LabelerConfigV1
- type SizeConfig
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition struct {
CanEvaluate func(target *Target) bool
Evaluate func(target *Target, matcher LabelMatcher) (bool, error)
GetName func() string
}
func AgeCondition ¶ added in v1.8.0
func AuthorCanMergeCondition ¶
func AuthorCanMergeCondition() Condition
func AuthorCondition ¶
func AuthorCondition() Condition
func AuthorInTeamCondition ¶ added in v1.11.0
func BaseBranchCondition ¶
func BaseBranchCondition() Condition
func BodyCondition ¶
func BodyCondition() Condition
func BranchCondition ¶
func BranchCondition() Condition
func FilesCondition ¶
func IsDraftCondition ¶
func IsDraftCondition() Condition
func IsMergeableCondition ¶
func IsMergeableCondition() Condition
func LastModifiedCondition ¶ added in v1.11.0
func SizeCondition ¶
func TitleCondition ¶
func TitleCondition() Condition
func TypeCondition ¶ added in v1.9.0
func TypeCondition() Condition
type DefaultHttpClient ¶
type DefaultHttpClient struct {
// contains filtered or unexported fields
}
type DurationConfig ¶ added in v1.11.0
type GitHubFacade ¶ added in v1.5.0
type GitHubFacade struct {
GetRawDiff func(owner, repo string, prNumber int) (string, error)
ListIssuesByRepo func(owner, repo string) ([]*gh.Issue, error)
ListPRs func(owner, repo string) ([]*gh.PullRequest, error)
IsUserMemberOfTeam func(org, user, team string) (bool, error)
}
Just to make this mockable..
type HttpClient ¶
func NewDefaultHttpClient ¶
func NewDefaultHttpClient() HttpClient
type LabelMatcher ¶
type LabelMatcher struct {
Age string `yaml:"age,omitempty"` // Deprecated age config.
AgeRange *DurationConfig `yaml:"age-range,omitempty"`
AuthorCanMerge string `yaml:"author-can-merge"`
Authors []string
AuthorInTeam string `yaml:"author-in-team"`
BaseBranch string `yaml:"base-branch"`
Body string
Branch string
Draft string
Files []string
Label string
LastModified *DurationConfig `yaml:"last-modified"`
Mergeable string
Negate bool
Size *SizeConfig
// size-legacy
// These two are unused in the codebase (they get copied inside
// the Size object), but we keep them to respect backwards
// compatiblity parsing older configs without adding more
// complexity.
SizeAbove string `yaml:"size-above"`
SizeBelow string `yaml:"size-below"`
// size-legacy
Title string
Type string
}
type LabelUpdates ¶
type LabelUpdates struct {
// contains filtered or unexported fields
}
LabelUpdates Represents a request to update the set of labels
type Labeler ¶
type Labeler struct {
FetchRepoConfig func() (*LabelerConfigV1, error)
ReplaceLabels func(target *Target, labels []string) error
GetCurrentLabels func(target *Target) ([]string, error)
GitHubFacade *GitHubFacade
Client HttpClient
}
func (*Labeler) HandleEvent ¶
HandleEvent takes a GitHub Event and its raw payload (see link below) to trigger an update to the issue / PR's labels.
func (*Labeler) ProcessAllIssues ¶
func (*Labeler) ProcessAllPRs ¶
type LabelerConfigV0 ¶
type LabelerConfigV0 map[string]LabelMatcher
type LabelerConfigV1 ¶
type LabelerConfigV1 struct {
Version int32
// When set to true, scheduled executions will process both PRs and
// issues. Else, we will only process PRs. Defaults to "False"
Issues bool
// When set to true, we will only add labels when they match a rule
// but it will NOT remove labels that were previously set and stop
// matching a rule
AppendOnly bool `yaml:"appendOnly"`
Labels []LabelMatcher
}
type SizeConfig ¶ added in v1.5.0
Source Files
¶
- condition_age.go
- condition_author.go
- condition_author_can_merge.go
- condition_author_in_team.go
- condition_basebranch.go
- condition_body.go
- condition_branch.go
- condition_files.go
- condition_isdraft.go
- condition_ismergeable.go
- condition_last_modified.go
- condition_size.go
- condition_title.go
- condition_type.go
- http.go
- labeler.go
- util.go
Click to show internal directories.
Click to hide internal directories.