policy

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParsePolicy

func ParsePolicy(c *Config, opts *GlobalOptions) (common.Evaluator, error)

Types

type Config

type Config struct {
	Policy           Policy             `yaml:"policy,omitempty"`
	ApprovalDefaults *approval.Defaults `yaml:"approval_defaults,omitempty"`
	ApprovalRules    []*approval.Rule   `yaml:"approval_rules,omitempty"`
}

type GlobalOptions added in v1.38.0

type GlobalOptions struct {
	// IgnoreEditedComments, if non-nil, overrides the value of this option in
	// all rules. If true, editing a comment will invalidate the comment for
	// approval in all policies.
	IgnoreEditedComments *bool

	// ApprovalDefaults defines server-level default values for policies. For
	// instance, this can change the default approval strings for all policies.
	ApprovalDefaults *approval.Defaults
}

GlobalOptions defines server-level properties that affect policy parsing, like default or override values.

type Policy

type Policy struct {
	Approval    approval.Policy     `yaml:"approval,omitempty"`
	Disapproval *disapproval.Policy `yaml:"disapproval,omitempty"`
}

type RemoteConfig

type RemoteConfig struct {
	Remote string `yaml:"remote,omitempty"`
	Path   string `yaml:"path,omitempty"`
	Ref    string `yaml:"ref,omitempty"`
}

RemoteConfig allows the use of a remote policy file, rather than a local one. The Remote value should follow the format `org/repo`. An example: `palantir/policy-bot`. The Path is optional, with the default value being the configured default policy file location. The Ref is optional, and the default branch of the Remote repository will be used.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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