approval

package
v1.36.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndRequirement

type AndRequirement struct {
	// contains filtered or unexported fields
}

func (*AndRequirement) Evaluate

func (r *AndRequirement) Evaluate(ctx context.Context, prctx pull.Context) common.Result

func (*AndRequirement) Trigger added in v1.20.0

func (r *AndRequirement) Trigger() common.Trigger

type Options

type Options struct {
	AllowAuthor               bool `yaml:"allow_author"`
	AllowContributor          bool `yaml:"allow_contributor"`
	AllowNonAuthorContributor bool `yaml:"allow_non_author_contributor"`
	InvalidateOnPush          bool `yaml:"invalidate_on_push"`

	IgnoreEditedComments bool          `yaml:"ignore_edited_comments"`
	IgnoreUpdateMerges   bool          `yaml:"ignore_update_merges"`
	IgnoreCommitsBy      common.Actors `yaml:"ignore_commits_by"`

	RequestReview RequestReview `yaml:"request_review"`

	Methods *common.Methods `yaml:"methods"`
}

func (*Options) GetMethods

func (opts *Options) GetMethods() *common.Methods

type OrRequirement

type OrRequirement struct {
	// contains filtered or unexported fields
}

func (*OrRequirement) Evaluate

func (r *OrRequirement) Evaluate(ctx context.Context, prctx pull.Context) common.Result

func (*OrRequirement) Trigger added in v1.20.0

func (r *OrRequirement) Trigger() common.Trigger

type Policy

type Policy []interface{}

func (Policy) Parse

func (p Policy) Parse(rules map[string]*Rule) (common.Evaluator, error)

type RequestReview

type RequestReview struct {
	Enabled bool               `yaml:"enabled"`
	Mode    common.RequestMode `yaml:"mode"`
	Count   int                `yaml:"count"`
}

type Requires

type Requires struct {
	Count      int                  `yaml:"count"`
	Actors     common.Actors        `yaml:",inline"`
	Conditions predicate.Predicates `yaml:"conditions"`
}

type Rule

type Rule struct {
	Name        string               `yaml:"name"`
	Description string               `yaml:"description"`
	Predicates  predicate.Predicates `yaml:"if"`
	Options     Options              `yaml:"options"`
	Requires    Requires             `yaml:"requires"`
}

func (*Rule) Evaluate

func (r *Rule) Evaluate(ctx context.Context, prctx pull.Context) (res common.Result)

func (*Rule) FilteredCandidates added in v1.27.0

func (r *Rule) FilteredCandidates(ctx context.Context, prctx pull.Context) ([]*common.Candidate, []*common.Dismissal, error)

FilteredCandidates returns the potential approval candidates and any candidates that should be dimissed due to rule options.

func (*Rule) IsApproved

func (r *Rule) IsApproved(ctx context.Context, prctx pull.Context, candidates []*common.Candidate) (bool, common.RequiresResult, error)

func (*Rule) Trigger added in v1.20.0

func (r *Rule) Trigger() common.Trigger

type RuleRequirement

type RuleRequirement struct {
	// contains filtered or unexported fields
}

func (*RuleRequirement) Evaluate

func (r *RuleRequirement) Evaluate(ctx context.Context, prctx pull.Context) common.Result

func (*RuleRequirement) Trigger added in v1.20.0

func (r *RuleRequirement) Trigger() common.Trigger

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL