Documentation ¶
Overview ¶
Package config knows how to read and parse config.yaml.
Index ¶
- func BranchRequirements(org, repo, branch string, presubmits map[string][]job.Presubmit) ([]string, []string, []string)
- func VolumeMountPaths() []string
- func VolumeMounts() []string
- type Agent
- type Config
- func (c *Config) GetBranchProtection(org, repo, branch string) (*branchprotection.Policy, error)
- func (c Config) GetKeeperContextPolicy(org, repo, branch string) (*keeper.ContextPolicy, error)
- func (c *Config) GetPolicy(org, repo, branch string, b branchprotection.Branch) (*branchprotection.Policy, error)
- func (c *Config) GetPostsubmits(repository scm.Repository) []job.Postsubmit
- func (c *Config) GetPresubmits(repository scm.Repository) []job.Presubmit
- type Cookie
- type Delta
- type DeltaChan
- type Getter
- type GithubOAuthConfig
- type JobConfig
- type ProwConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchRequirements ¶
func BranchRequirements(org, repo, branch string, presubmits map[string][]job.Presubmit) ([]string, []string, []string)
BranchRequirements partitions status contexts for a given org, repo branch into three buckets:
- contexts that are always required to be present
- contexts that are required, _if_ present
- contexts that are always optional
func VolumeMountPaths ¶
func VolumeMountPaths() []string
VolumeMountPaths returns a string slice with *MountPath consts in it.
func VolumeMounts ¶
func VolumeMounts() []string
VolumeMounts returns a string slice with *MountName consts in it.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent watches a path and automatically loads the config stored therein.
type Config ¶
type Config struct { JobConfig ProwConfig }
Config is a read-only snapshot of the config.
func LoadYAMLConfig ¶
LoadYAMLConfig loads the configuration from the given data
func (*Config) GetBranchProtection ¶
func (c *Config) GetBranchProtection(org, repo, branch string) (*branchprotection.Policy, error)
GetBranchProtection returns the policy for a given branch.
Handles merging any policies defined at repo/org/global levels into the branch policy.
func (Config) GetKeeperContextPolicy ¶
func (c Config) GetKeeperContextPolicy(org, repo, branch string) (*keeper.ContextPolicy, error)
GetKeeperContextPolicy parses the prow config to find context merge options. If none are set, it will use the prow jobs configured and use the default github combined status. Otherwise if set it will use the branch protection setting, or the listed jobs.
func (*Config) GetPolicy ¶
func (c *Config) GetPolicy(org, repo, branch string, b branchprotection.Branch) (*branchprotection.Policy, error)
GetPolicy returns the protection policy for the branch, after merging in presubmits.
func (*Config) GetPostsubmits ¶
func (c *Config) GetPostsubmits(repository scm.Repository) []job.Postsubmit
GetPostsubmits lets return all the post submits
func (*Config) GetPresubmits ¶
func (c *Config) GetPresubmits(repository scm.Repository) []job.Presubmit
GetPresubmits lets return all the pre submits for the given repo
type Cookie ¶
type Cookie struct {
Secret string `json:"secret,omitempty"`
}
Cookie holds the secret returned from github that authenticates the user who authorized this app.
type Delta ¶
type Delta struct {
Before, After Config
}
Delta represents the before and after states of a Config change detected by the Agent.
type DeltaChan ¶
type DeltaChan = chan<- Delta
DeltaChan is a channel to receive config delta events when config changes.
type GithubOAuthConfig ¶
type GithubOAuthConfig struct { ClientID string `json:"client_id"` ClientSecret string `json:"client_secret"` RedirectURL string `json:"redirect_url"` Scopes []string `json:"scopes,omitempty"` FinalRedirectURL string `json:"final_redirect_url"` CookieStore *sessions.CookieStore `json:"-"` }
GithubOAuthConfig is a config for requesting users access tokens from Github API. It also has a Cookie Store that retains user credentials deriving from Github API.
func (*GithubOAuthConfig) InitGithubOAuthConfig ¶
func (gac *GithubOAuthConfig) InitGithubOAuthConfig(cookie *sessions.CookieStore)
InitGithubOAuthConfig creates an OAuthClient using GithubOAuth config and a Cookie Store to retain user credentials.
type ProwConfig ¶
type ProwConfig = lighthouse.Config
ProwConfig is a type alias for lighthouse.Config
Directories ¶
Path | Synopsis |
---|---|
Package secret implements an agent to read and reload the secrets.
|
Package secret implements an agent to read and reload the secrets. |