Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actors ¶
type Actors struct { Users []string `yaml:"users" json:"users"` Teams []string `yaml:"teams" json:"teams"` Organizations []string `yaml:"organizations" json:"organizations"` // Deprecated: use Permissions with "admin" or "write" Admins bool `yaml:"admins" json:"-"` WriteCollaborators bool `yaml:"write_collaborators" json:"-"` // A list of GitHub collaborator permissions that are allowed. Values may // be any of "admin", "maintain", "write", "triage", and "read". Permissions []pull.Permission `yaml:"permissions" json:"permissions"` }
Actors specifies who may take certain actions based on their username or team and organization memberships. The set of allowed actors is the union of all conditions in this structure.
func (*Actors) GetPermissions ¶ added in v1.26.0
func (a *Actors) GetPermissions() []pull.Permission
GetPermissions returns unique permissions ordered from most to least permissive. It includes the permissions from the deprecated Admins and WriteCollaborators fields.
type CandidateType ¶ added in v1.27.0
type CandidateType string
const ( ReviewCandidate CandidateType = "review" CommentCandidate CandidateType = "comment" )
type CandidatesByCreationTime ¶
type CandidatesByCreationTime []*Candidate
func (CandidatesByCreationTime) Len ¶
func (cs CandidatesByCreationTime) Len() int
func (CandidatesByCreationTime) Less ¶
func (cs CandidatesByCreationTime) Less(i, j int) bool
func (CandidatesByCreationTime) Swap ¶
func (cs CandidatesByCreationTime) Swap(i, j int)
type EvaluationStatus ¶
type EvaluationStatus int
const ( StatusSkipped EvaluationStatus = iota // note: values used for ordering StatusPending StatusApproved StatusDisapproved )
func (EvaluationStatus) String ¶
func (s EvaluationStatus) String() string
type Methods ¶
type Methods struct { Comments []string `yaml:"comments,omitempty"` CommentPatterns []Regexp `yaml:"comment_patterns,omitempty"` GithubReview *bool `yaml:"github_review,omitempty"` GithubReviewCommentPatterns []Regexp `yaml:"github_review_comment_patterns,omitempty"` BodyPatterns []Regexp `yaml:"body_patterns,omitempty"` // If GithubReview is true, GithubReviewState is the state a review must // have to be considered a candidated. It is currently excluded from // serialized forms and should be set by the application. GithubReviewState pull.ReviewState `yaml:"-" json:"-"` }
func (*Methods) BodyMatches ¶ added in v1.27.0
func (*Methods) Candidates ¶
Candidates returns a list of user candidates based on the configured methods. A given user will appear at most once in the list. If that user has taken multiple actions that match the methods, only the most recent by event order is included. The order of the candidates is unspecified.
func (*Methods) CommentMatches ¶
type PredicateResult ¶ added in v1.25.0
type PredicateResult struct { Satisfied bool Description string // Describes the values, used as "the $ValuesPhrase"; must be plural ValuePhrase string Values []string // Describes the condition, used as "$ConditionPhrase" or "does not $ConditionPhrase" ConditionPhrase string // If non-empty, use the map, otherwise, use the regular list ConditionsMap map[string][]string ConditionValues []string }
type Regexp ¶
type Regexp struct {
// contains filtered or unexported fields
}
Regexp is a regexp.Regexp that only supports matching and can be deserialized from a string.
func NewCompiledRegexp ¶
func (*Regexp) UnmarshalJSON ¶
func (*Regexp) UnmarshalYAML ¶
type RequestMode ¶
type RequestMode string
const ( RequestModeAllUsers RequestMode = "all-users" RequestModeRandomUsers RequestMode = "random-users" RequestModeTeams RequestMode = "teams" )
type Result ¶
type Result struct { Name string Description string StatusDescription string Status EvaluationStatus Error error PredicateResults []*PredicateResult Requires Requires Methods *Methods // Approvers contains the candidates that satisfied the rule. Approvers []*Candidate // Dismissals contains candidates that should be discarded because they // cannot satisfy any future evaluations. Dismissals []*Dismissal ReviewRequestRule *ReviewRequestRule Children []*Result }
type ReviewRequestRule ¶
type ReviewRequestRule struct { Teams []string Users []string Organizations []string Permissions []pull.Permission RequiredCount int RequestedCount int Mode RequestMode }
type Trigger ¶ added in v1.20.0
type Trigger uint32
Trigger is a flag set that marks the types of GitHub events that could change the value of a predicate or evaluation. It is used to optimize evaluation by skipping unnecessary work.
const ( TriggerCommit Trigger = 1 << iota TriggerComment TriggerReview TriggerLabel TriggerStatus TriggerPullRequest // TriggerStatic is a name for the empty trigger set and means the // computation never needs updating. TriggerStatic Trigger = 0 // TriggerAll is a name for the full trigger set and means the computation // should update after any changes to the pull request. TriggerAll Trigger = TriggerCommit | TriggerComment | TriggerReview | TriggerLabel | TriggerStatus | TriggerPullRequest )