plugins

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 23 Imported by: 7

Documentation

Index

Constants

AboutThisBot contains the text of both AboutThisBotWithoutCommands and AboutThisBotCommands.

View Source
const AboutThisBotCommands = "I understand the commands that are listed [here](https://go.k8s.io/bot-commands)."

AboutThisBotCommands contains the message that links to the commands the bot understand.

View Source
const AboutThisBotWithoutCommands = "" /* 347-byte string literal not displayed */

AboutThisBotWithoutCommands contains the message that explains how to interact with the bot.

Variables

This section is empty.

Functions

func Always added in v0.0.817

Always is a condition that always evaluates to true

func FormatICResponse

func FormatICResponse(ic scm.Comment, s string) string

FormatICResponse nicely formats a response to an issue comment.

func FormatResponse

func FormatResponse(to, message, reason string) string

FormatResponse nicely formats a response to a generic reason.

func FormatResponseRaw

func FormatResponseRaw(body, bodyURL, login, reply string) string

FormatResponseRaw nicely formats a response for one does not have an issue comment

func FormatSimpleResponse

func FormatSimpleResponse(to, message string) string

FormatSimpleResponse formats a response that does not warrant additional explanation in the details section.

func HelpProviders

func HelpProviders() map[string]HelpProvider

HelpProviders returns the map of registered plugins with their associated HelpProvider.

func Never added in v0.0.817

Never is a condition that always evaluates to false

func RegisterPlugin added in v0.0.790

func RegisterPlugin(name string, plugin Plugin)

RegisterPlugin registers a plugin.

Types

type Agent

type Agent struct {
	SCMProviderClient *scmprovider.Client
	LauncherClient    launcher.PipelineLauncher
	GitClient         git.Client
	KubernetesClient  kubernetes.Interface
	LighthouseClient  lighthouseclient.LighthouseJobInterface
	ServerURL         *url.URL

	OwnersClient *repoowners.Client

	// Config provides information about the jobs
	// that we know how to run for repos.
	Config *config.Config
	// PluginConfig provides plugin-specific options
	PluginConfig *Configuration

	Logger *logrus.Entry

	// may be nil if not initialized
	Commentpruner *commentpruner.EventClient
}

Agent may be used concurrently, so each entry must be thread-safe.

func NewAgent

func NewAgent(configAgent *config.Agent, pluginConfigAgent *ConfigAgent, clientAgent *ClientAgent, serverURL *url.URL, logger *logrus.Entry) Agent

NewAgent bootstraps a new Agent struct from the passed dependencies.

func (*Agent) CommentPruner

func (a *Agent) CommentPruner() (*commentpruner.EventClient, error)

CommentPruner will return the commentpruner.EventClient attached to the agent or an error if one is not attached.

func (*Agent) InitializeCommentPruner

func (a *Agent) InitializeCommentPruner(org, repo string, pr int)

InitializeCommentPruner attaches a commentpruner.EventClient to the agent to handle pruning comments.

type Approve

type Approve struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// IssueRequired indicates if an associated issue is required for approval in
	// the specified repos.
	IssueRequired bool `json:"issue_required,omitempty"`
	// RequireSelfApproval requires PR authors to explicitly approve their PRs.
	// Otherwise the plugin assumes the author of the PR approves the changes in the PR.
	RequireSelfApproval *bool `json:"require_self_approval,omitempty"`
	// LgtmActsAsApprove indicates that the lgtm command should be used to
	// indicate approval
	LgtmActsAsApprove bool `json:"lgtm_acts_as_approve,omitempty"`
	// IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise:
	// * an APPROVE github review is equivalent to leaving an "/approve" message.
	// * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel" message.
	IgnoreReviewState *bool `json:"ignore_review_state,omitempty"`
	// IgnoreUpdateBot makes the approve plugin ignore PRs with the label updatebot
	IgnoreUpdateBot *bool `json:"ignore_updatebot,omitempty"`
}

Approve specifies a configuration for a single approve.

The configuration for the approve plugin is defined as a list of these structures.

func (Approve) ConsiderReviewState

func (a Approve) ConsiderReviewState() bool

ConsiderReviewState checks if the rewview state is active

func (Approve) HasSelfApproval

func (a Approve) HasSelfApproval() bool

HasSelfApproval checks if it has self-approval

func (Approve) IgnoreUpdateBotLabel added in v1.11.6

func (a Approve) IgnoreUpdateBotLabel() bool

ConsiderReviewState checks if the rewview state is active

type Blockade

type Blockade struct {
	// Repos are either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// BlockRegexps are regular expressions matching the file paths to block.
	BlockRegexps []string `json:"blockregexps,omitempty"`
	// ExceptionRegexps are regular expressions matching the file paths that are exceptions to the BlockRegexps.
	ExceptionRegexps []string `json:"exceptionregexps,omitempty"`
	// Explanation is a string that will be included in the comment left when blocking a PR. This should
	// be an explanation of why the paths specified are blockaded.
	Explanation string `json:"explanation,omitempty"`
}

Blockade specifies a configuration for a single blockade.

The configuration for the blockade plugin is defined as a list of these structures.

type Cat

type Cat struct {
	// Path to file containing an api key for thecatapi.com
	KeyPath string `json:"key_path,omitempty"`
}

Cat contains the configuration for the cat plugin.

type CherryPickUnapproved

type CherryPickUnapproved struct {
	// BranchRegexp is the regular expression for branch names such that
	// the plugin treats only PRs against these branch names as cherrypick PRs.
	// Compiles into BranchRe during config load.
	BranchRegexp string         `json:"branchregexp,omitempty"`
	BranchRe     *regexp.Regexp `json:"-"`
	// Comment is the comment added by the plugin while adding the
	// `do-not-merge/cherry-pick-not-approved` label.
	Comment string `json:"comment,omitempty"`
}

CherryPickUnapproved is the config for the cherrypick-unapproved plugin.

type ClientAgent

type ClientAgent struct {
	BotName           string
	SCMProviderClient *scm.Client

	KubernetesClient kubernetes.Interface
	GitClient        git.Client
	LauncherClient   launcher.PipelineLauncher
	LighthouseClient lighthouseclient.LighthouseJobInterface
}

ClientAgent contains the various clients that are attached to the Agent.

type Command added in v0.0.793

type Command struct {
	Prefix      string
	Name        string
	Arg         *CommandArg
	Description string
	Featured    bool
	WhoCanUse   string
	MaxMatches  int
	Action      CommandInvoker
	// contains filtered or unexported fields
}

Command defines a plugin command sent through a comment

func (Command) FilterAndGetMatches added in v0.0.815

func (cmd Command) FilterAndGetMatches(event *scmprovider.GenericCommentEvent) ([]CommandMatch, error)

FilterAndGetMatches filters the event and returns command matches

func (Command) GetHelp added in v0.0.815

func (cmd Command) GetHelp() pluginhelp.Command

GetHelp returns command help

func (Command) GetMatches added in v0.0.802

func (cmd Command) GetMatches(content string) ([]CommandMatch, error)

GetMatches returns command matches

func (*Command) GetRegex added in v0.0.815

func (cmd *Command) GetRegex() *regexp.Regexp

GetRegex creates the regular expression from a command syntax

func (Command) InvokeCommandHandler added in v0.0.797

InvokeCommandHandler performs command checks (filter, then regex if any) the calls the handler with the match (if any)

type CommandArg added in v0.0.815

type CommandArg struct {
	Usage    string
	Pattern  string
	Optional bool
}

CommandArg defines a plugin command argument

func (*CommandArg) GetRegex added in v0.0.815

func (a *CommandArg) GetRegex() string

GetRegex returns the regex string corresponding to the definiition of a CommandArg

func (*CommandArg) GetUsage added in v0.0.815

func (a *CommandArg) GetUsage() string

GetUsage returns the CommandArg usage

type CommandEventHandler added in v0.0.812

type CommandEventHandler func(CommandMatch, Agent, scmprovider.GenericCommentEvent) error

CommandEventHandler defines the function contract for a command handler.

type CommandInvoker added in v0.0.817

type CommandInvoker struct {
	Condition func(scmprovider.GenericCommentEvent) bool
	Handler   CommandEventHandler
}

CommandInvoker defines a plugin command handler and the condition needed for the handler to be invoked

func Invoke added in v0.0.817

func Invoke(handler CommandEventHandler) CommandInvoker

Invoke creates a CommandAction from a handler and a condition

func (CommandInvoker) When added in v0.0.817

func (action CommandInvoker) When(conditions ...ConditionFunc) CommandInvoker

When creates a CommandAction from an existing CommandAction and a condition (combining conditions with AND)

type CommandMatch added in v0.0.815

type CommandMatch struct {
	Prefix string
	Name   string
	Arg    string
}

CommandMatch defines a plugin command match to be passed to the command handler

type ConditionFunc added in v0.0.817

type ConditionFunc func(scmprovider.GenericCommentEvent) bool

ConditionFunc defines a condition used for invoking commands

func Action added in v0.0.817

func Action(actions ...scm.Action) ConditionFunc

Action returns a ConditionFunc that checks event action

func IsNotPR added in v0.0.817

func IsNotPR() ConditionFunc

IsNotPR returns a ConditionFunc that checks if event doesn't concerns a pull request

func IsPR added in v0.0.817

func IsPR() ConditionFunc

IsPR returns a ConditionFunc that checks if event concerns a pull request

func IssueState added in v0.0.817

func IssueState(states ...string) ConditionFunc

IssueState returns a ConditionFunc that checks event issue state

func Not added in v0.0.817

func Not(condition ConditionFunc) ConditionFunc

Not negates a condition

func NotIssueState added in v0.0.817

func NotIssueState(states ...string) ConditionFunc

NotIssueState returns a ConditionFunc that checks event issue state

type ConfigAgent

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

ConfigAgent contains the agent mutex and the Agent configuration.

func (*ConfigAgent) Config

func (pa *ConfigAgent) Config() *Configuration

Config returns the agent current Configuration.

func (*ConfigAgent) GetPlugins added in v0.0.791

func (pa *ConfigAgent) GetPlugins(owner, repo, provider string) map[string]Plugin

GetPlugins returns a map of plugin names to plugins for the repo.

func (*ConfigAgent) Load

func (pa *ConfigAgent) Load(path string) error

Load attempts to load config from the path. It returns an error if either the file can't be read or the configuration is invalid.

func (*ConfigAgent) LoadYAMLConfig

func (pa *ConfigAgent) LoadYAMLConfig(data []byte) (*Configuration, error)

LoadYAMLConfig loads the configuration from the given data

func (*ConfigAgent) Set

func (pa *ConfigAgent) Set(pc *Configuration)

Set attempts to set the plugins that are enabled on repos. Plugins are listed as a map from repositories to the list of plugins that are enabled on them. Specifying simply an org name will also work, and will enable the plugin on all repos in the org.

type ConfigHelpProvider added in v0.0.794

type ConfigHelpProvider func(config *Configuration, enabledRepos []string) (map[string]string, error)

ConfigHelpProvider defines the function type that constructs help about a plugin configuration.

type ConfigMapSpec

type ConfigMapSpec struct {
	// Name of ConfigMap
	Name string `json:"name"`
	// Key is the key in the ConfigMap to update with the file contents.
	// If no explicit key is given, the basename of the file will be used.
	Key string `json:"key,omitempty"`
	// Namespace in which the configMap needs to be deployed. If no namespace is specified
	// it will be deployed to the LighthouseJobNamespace.
	Namespace string `json:"namespace,omitempty"`
	// Namespaces in which the configMap needs to be deployed, in addition to the above
	// namespace provided, or the default if it is not set.
	AdditionalNamespaces []string `json:"additional_namespaces,omitempty"`
	// GZIP toggles whether the key's data should be GZIP'd before being stored
	// If set to false and the global GZIP option is enabled, this file will
	// will not be GZIP'd.
	GZIP *bool `json:"gzip,omitempty"`
	// Namespaces is the fully resolved list of Namespaces to deploy the ConfigMap in
	Namespaces []string `json:"-"`
}

ConfigMapSpec contains configuration options for the configMap being updated by the config-updater plugin.

type ConfigUpdater

type ConfigUpdater struct {
	// A map of filename => ConfigMapSpec.
	// Whenever a commit changes filename, prow will update the corresponding configmap.
	// map[string]ConfigMapSpec{ "/my/path.yaml": {Name: "foo", Namespace: "otherNamespace" }}
	// will result in replacing the foo configmap whenever path.yaml changes
	Maps map[string]ConfigMapSpec `json:"maps,omitempty"`
	// If GZIP is true then files will be gzipped before insertion into
	// their corresponding configmap
	GZIP bool `json:"gzip"`
}

ConfigUpdater contains the configuration for the config-updater plugin.

func (*ConfigUpdater) SetDefaults

func (c *ConfigUpdater) SetDefaults()

SetDefaults sets default options for config updating

type Configuration

type Configuration struct {
	// Plugins is a map of repositories (eg "k/k") to lists of
	// plugin names.
	// TODO: Link to the list of supported plugins.
	// https://github.com/kubernetes/test-infra/issues/3476
	Plugins map[string][]string `json:"plugins,omitempty"`

	// ExternalPlugins is a map of repositories (eg "k/k") to lists of
	// external plugins.
	ExternalPlugins map[string][]ExternalPlugin `json:"external_plugins,omitempty"`

	// Owners contains configuration related to handling OWNERS files.
	Owners Owners `json:"owners,omitempty"`

	// Built-in plugins specific configuration.
	Approve              []Approve              `json:"approve,omitempty"`
	Blockades            []Blockade             `json:"blockades,omitempty"`
	Cat                  Cat                    `json:"cat,omitempty"`
	CherryPickUnapproved CherryPickUnapproved   `json:"cherry_pick_unapproved,omitempty"`
	ConfigUpdater        ConfigUpdater          `json:"config_updater,omitempty"`
	Label                Label                  `json:"label,omitempty"`
	Lgtm                 []Lgtm                 `json:"lgtm,omitempty"`
	RepoMilestone        map[string]Milestone   `json:"repo_milestone,omitempty"`
	RequireMatchingLabel []RequireMatchingLabel `json:"require_matching_label,omitempty"`
	RequireSIG           RequireSIG             `json:"requiresig,omitempty"`
	SigMention           SigMention             `json:"sigmention,omitempty"`
	Size                 Size                   `json:"size,omitempty"`
	Triggers             []Trigger              `json:"triggers,omitempty"`
	Welcome              []Welcome              `json:"welcome,omitempty"`
}

Configuration is the top-level serialization target for plugin Configuration.

func (*Configuration) EnabledReposForExternalPlugin

func (c *Configuration) EnabledReposForExternalPlugin(plugin string) (orgs, repos []string)

EnabledReposForExternalPlugin returns the orgs and repos that have enabled the passed external plugin.

func (*Configuration) EnabledReposForPlugin

func (c *Configuration) EnabledReposForPlugin(plugin string) (orgs, repos []string)

EnabledReposForPlugin returns the orgs and repos that have enabled the passed plugin.

func (*Configuration) MDYAMLEnabled

func (c *Configuration) MDYAMLEnabled(org, repo string) bool

MDYAMLEnabled returns a boolean denoting if the passed repo supports YAML OWNERS config headers at the top of markdown (*.md) files. These function like OWNERS files but only apply to the file itself.

func (*Configuration) SkipCollaborators

func (c *Configuration) SkipCollaborators(org, repo string) bool

SkipCollaborators returns a boolean denoting if collaborator cross-checks are enabled for the passed repo. If it's true, approve and lgtm plugins rely solely on OWNERS files.

func (*Configuration) TriggerFor

func (c *Configuration) TriggerFor(org, repo string) *Trigger

TriggerFor finds the Trigger for a repo, if one exists a trigger can be listed for the repo itself or for the owning organization

func (*Configuration) Validate

func (c *Configuration) Validate() error

Validate validates the plugin configuration

func (*Configuration) ValidatePluginsArePresent added in v0.0.693

func (c *Configuration) ValidatePluginsArePresent(presentPlugins map[string]interface{}) error

ValidatePluginsArePresent takes a map with plugin names as keys and errors or logs for each configured plugin that can't be found.

type DeploymentStatusHandler added in v1.16.0

type DeploymentStatusHandler func(Agent, scm.DeploymentStatusHook) error

type ExternalPlugin

type ExternalPlugin struct {
	// Name of the plugin.
	Name string `json:"name"`
	// Endpoint is the location of the external plugin. Defaults to
	// the name of the plugin, ie. "http://{{name}}".
	Endpoint string `json:"endpoint,omitempty"`
	// Events are the events that need to be demuxed by the hook
	// server to the external plugin. If no events are specified,
	// everything is sent.
	Events []string `json:"events,omitempty"`
}

ExternalPlugin holds configuration for registering an external plugin in prow.

type GenericCommentHandler

type GenericCommentHandler func(Agent, scmprovider.GenericCommentEvent) error

GenericCommentHandler defines the function contract for a scm.Comment handler.

type HelpProvider

type HelpProvider func(config *Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error)

HelpProvider defines the function type that construct a pluginhelp.PluginHelp for enabled plugins. It takes into account the plugins configuration and enabled repositories.

type IssueHandler

type IssueHandler func(Agent, scm.Issue) error

IssueHandler defines the function contract for a scm.Issue handler.

type Label

type Label struct {
	// AdditionalLabels is a set of additional labels enabled for use
	// on top of the existing "kind/*", "priority/*", and "area/*" labels.
	AdditionalLabels []string `json:"additional_labels"`
}

Label contains the configuration for the label plugin.

type Lgtm

type Lgtm struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// ReviewActsAsLgtm indicates that a Github review of "approve" or "request changes"
	// acts as adding or removing the lgtm label
	ReviewActsAsLgtm bool `json:"review_acts_as_lgtm,omitempty"`
	// StoreTreeHash indicates if tree_hash should be stored inside a comment to detect
	// squashed commits before removing lgtm labels
	StoreTreeHash bool `json:"store_tree_hash,omitempty"`
	// WARNING: This disables the security mechanism that prevents a malicious member (or
	// compromised GitHub account) from merging arbitrary code. Use with caution.
	//
	// StickyLgtmTeam specifies the Github team whose members are trusted with sticky LGTM,
	// which eliminates the need to re-lgtm minor fixes/updates.
	StickyLgtmTeam string `json:"trusted_team_for_sticky_lgtm,omitempty"`
}

Lgtm specifies a configuration for a single lgtm. The configuration for the lgtm plugin is defined as a list of these structures.

type Milestone

type Milestone struct {
	// ID of the github team for the milestone maintainers (used for setting status labels)
	// You can curl the following endpoint in order to determine the gitprovider.ID of your team
	// responsible for maintaining the milestones:
	// curl -H "Authorization: token <token>" https://api.github.com/orgs/<org-name>/teams
	MaintainersID           int    `json:"maintainers_id,omitempty"`
	MaintainersTeam         string `json:"maintainers_team,omitempty"`
	MaintainersFriendlyName string `json:"maintainers_friendly_name,omitempty"`
}

Milestone contains the configuration options for the milestone and milestonestatus plugins.

type Owners

type Owners struct {
	// MDYAMLRepos is a list of org and org/repo strings specifying the repos that support YAML
	// OWNERS config headers at the top of markdown (*.md) files. These headers function just like
	// the config in an OWNERS file, but only apply to the file itself instead of the entire
	// directory and all sub-directories.
	// The yaml header must be at the start of the file and be bracketed with "---" like so:
	/*
		---
		approvers:
		- mikedanese
		- thockin
		---
	*/
	MDYAMLRepos []string `json:"mdyamlrepos,omitempty"`
	// SkipCollaborators disables collaborator cross-checks and forces both
	// the approve and lgtm plugins to use solely OWNERS files for access
	// control in the provided repos.
	SkipCollaborators []string `json:"skip_collaborators,omitempty"`
	// LabelsExcludeList holds a list of labels that should not be present in any
	// OWNERS file, preventing their automatic addition by the owners-label plugin.
	// This check is performed by the verify-owners plugin.
	LabelsExcludeList []string `json:"labels_excludes,omitempty"`
}

Owners contains configuration related to handling OWNERS files.

type Plugin added in v0.0.790

type Plugin struct {
	Description             string
	ExcludedProviders       sets.String
	ConfigHelpProvider      ConfigHelpProvider
	IssueHandler            IssueHandler
	PullRequestHandler      PullRequestHandler
	PushEventHandler        PushEventHandler
	ReviewEventHandler      ReviewEventHandler
	StatusEventHandler      StatusEventHandler
	DeploymentStatusHandler DeploymentStatusHandler
	GenericCommentHandler   GenericCommentHandler
	Commands                []Command
}

Plugin defines a plugin and its handlers

func (Plugin) GetHelp added in v0.0.816

func (plugin Plugin) GetHelp(config *Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error)

GetHelp returns plugin help

func (Plugin) InvokeCommandHandler added in v0.0.797

InvokeCommandHandler calls InvokeHandler on all commands

func (Plugin) IsProviderExcluded added in v0.0.816

func (plugin Plugin) IsProviderExcluded(provider string) bool

IsProviderExcluded returns true if the given provider is excluded, false otherwise

type PullRequestHandler

type PullRequestHandler func(Agent, scm.PullRequestHook) error

PullRequestHandler defines the function contract for a scm.PullRequest handler.

type PushEventHandler

type PushEventHandler func(Agent, scm.PushHook) error

PushEventHandler defines the function contract for a scm.PushHook handler.

type RequireMatchingLabel

type RequireMatchingLabel struct {
	// Org is the GitHub organization that this config applies to.
	Org string `json:"org,omitempty"`
	// Repo is the GitHub repository within Org that this config applies to.
	// This fields may be omitted to apply this config across all repos in Org.
	Repo string `json:"repo,omitempty"`
	// Branch is the branch ref of PRs that this config applies to.
	// This field is only valid if `prs: true` and may be omitted to apply this
	// config across all branches in the repo or org.
	Branch string `json:"branch,omitempty"`
	// PRs is a bool indicating if this config applies to PRs.
	PRs bool `json:"prs,omitempty"`
	// Issues is a bool indicating if this config applies to issues.
	Issues bool `json:"issues,omitempty"`

	// Regexp is the string specifying the regular expression used to look for
	// matching labels.
	Regexp string `json:"regexp,omitempty"`
	// Re is the compiled version of Regexp. It should not be specified in config.
	Re *regexp.Regexp `json:"-"`

	// MissingLabel is the label to apply if an issue does not have any label
	// matching the Regexp.
	MissingLabel string `json:"missing_label,omitempty"`
	// MissingComment is the comment to post when we add the MissingLabel to an
	// issue. This is typically used to explain why MissingLabel was added and
	// how to move forward.
	// This field is optional. If unspecified, no comment is created when labeling.
	MissingComment string `json:"missing_comment,omitempty"`

	// GracePeriod is the amount of time to wait before processing newly opened
	// or reopened issues and PRs. This delay allows other automation to apply
	// labels before we look for matching labels.
	// Defaults to '5s'.
	GracePeriod         string        `json:"grace_period,omitempty"`
	GracePeriodDuration time.Duration `json:"-"`
}

RequireMatchingLabel is the config for the require-matching-label plugin.

func (RequireMatchingLabel) Describe

func (r RequireMatchingLabel) Describe() string

Describe generates a human readable description of the behavior that this configuration specifies.

type RequireSIG

type RequireSIG struct {
	// GroupListURL is the URL where a list of the available SIGs can be found.
	GroupListURL string `json:"group_list_url,omitempty"`
}

RequireSIG specifies configuration for the require-sig plugin.

type ReviewEventHandler

type ReviewEventHandler func(Agent, scm.ReviewHook) error

ReviewEventHandler defines the function contract for a ReviewHook handler.

type SigMention

type SigMention struct {
	// Regexp parses comments and should return matches to team mentions.
	// These mentions enable labeling issues or PRs with sig/team labels.
	// Furthermore, teams with the following suffixes will be mapped to
	// kind/* labels:
	//
	// * @org/team-bugs             --maps to--> kind/bug
	// * @org/team-feature-requests --maps to--> kind/feature
	// * @org/team-api-reviews      --maps to--> kind/api-change
	// * @org/team-proposals        --maps to--> kind/design
	//
	// Note that you need to make sure your regexp covers the above
	// mentions if you want to use the extra labeling. Defaults to:
	// (?m)@kubernetes/sig-([\w-]*)-(misc|test-failures|bugs|feature-requests|proposals|pr-reviews|api-reviews)
	//
	// Compiles into Re during config load.
	Regexp string         `json:"regexp,omitempty"`
	Re     *regexp.Regexp `json:"-"`
}

SigMention specifies configuration for the sigmention plugin.

type Size

type Size struct {
	S   int `json:"s"`
	M   int `json:"m"`
	L   int `json:"l"`
	Xl  int `json:"xl"`
	Xxl int `json:"xxl"`
}

Size specifies configuration for the size plugin, defining lower bounds (in # lines changed) for each size label. XS is assumed to be zero.

type StatusEventHandler

type StatusEventHandler func(Agent, scm.Status) error

StatusEventHandler defines the function contract for a scm.Status handler.

type Trigger

type Trigger struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// TrustedOrg is the org whose members' PRs will be automatically built
	// for PRs to the above repos. The default is the PR's org.
	TrustedOrg string `json:"trusted_org,omitempty"`
	// TrustedApps is the explicit list of GitHub apps whose PRs will be automatically
	// considered as trusted. The list should contain usernames of each GitHub App without [bot] suffix.
	// By default, trigger will ignore this list.
	TrustedApps []string `json:"trusted_apps,omitempty"`
	// JoinOrgURL is a link that redirects users to a location where they
	// should be able to read more about joining the organization in order
	// to become trusted members. Defaults to the Github link of TrustedOrg.
	JoinOrgURL string `json:"join_org_url,omitempty"`
	// OnlyOrgMembers requires PRs and/or /ok-to-test comments to come from org members.
	// By default, trigger also include repo collaborators.
	OnlyOrgMembers bool `json:"only_org_members,omitempty"`
	// IgnoreOkToTest makes trigger ignore /ok-to-test comments.
	// This is a security mitigation to only allow testing from trusted users.
	IgnoreOkToTest bool `json:"ignore_ok_to_test,omitempty"`
	// ElideSkippedContexts makes trigger not post "Skipped" contexts for jobs
	// that could run but do not run.
	ElideSkippedContexts bool `json:"elide_skipped_contexts,omitempty"`
	// SkipDraftPR when enabled, skips triggering pipelines for draft PRs, unless /ok-to-test is added.
	SkipDraftPR bool `json:"skip_draft_pr,omitempty"`
	// SkipReportComment when enabled, skips report comments in the SCM provider based on the state of
	// the LighthouseJobs.
	SkipReportComment bool `json:"skip_report_comment,omitempty"`
	// SkipReportRunningStatus when enabled, skips report status in the SCM provider
	// based on the current and last state of the LighthouseJobs.
	SkipReportRunningStatus bool `json:"skip_report_running_status,omitempty"`
}

Trigger specifies a configuration for a single trigger.

The configuration for the trigger plugin is defined as a list of these structures.

type Welcome

type Welcome struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// MessageTemplate is the welcome message template to post on new-contributor PRs
	// For the info struct see prow/plugins/welcome/welcome.go's PRInfo
	MessageTemplate string `json:"message_template,omitempty"`
}

Welcome is config for the welcome plugin.

Directories

Path Synopsis
Package blockade defines a plugin that adds the 'do-not-merge/blocked-paths' label to PRs that modify protected file paths.
Package blockade defines a plugin that adds the 'do-not-merge/blocked-paths' label to PRs that modify protected file paths.
Package cat adds cat images to an issue or PR in response to a /meow comment
Package cat adds cat images to an issue or PR in response to a /meow comment
Package cherrypickunapproved adds the `do-not-merge/cherry-pick-not-approved` label to PRs against a release branch which do not have the `cherry-pick-approved` label.
Package cherrypickunapproved adds the `do-not-merge/cherry-pick-not-approved` label to PRs against a release branch which do not have the `cherry-pick-approved` label.
Package dog adds dog images to the issue or PR in response to a /woof comment
Package dog adds dog images to the issue or PR in response to a /woof comment
Package hold contains a plugin which will allow users to label their own pull requests as not ready or ready for merge.
Package hold contains a plugin which will allow users to label their own pull requests as not ready or ready for merge.
Package lgtm implements the lgtm plugin
Package lgtm implements the lgtm plugin
Package milestone implements the `/milestone` command which allows members of the milestone maintainers team to specify a milestone to be applied to an Issue or PR.
Package milestone implements the `/milestone` command which allows members of the milestone maintainers team to specify a milestone to be applied to an Issue or PR.
Package milestonestatus implements the `/status` command which allows members of the milestone maintainers team to specify a `status/*` label to be applied to an Issue or PR.
Package milestonestatus implements the `/status` command which allows members of the milestone maintainers team to specify a `status/*` label to be applied to an Issue or PR.
Package override supports the /override context command.
Package override supports the /override context command.
Package pony adds pony images to the issue or PR in response to a /pony comment
Package pony adds pony images to the issue or PR in response to a /pony comment
Package sigmention recognize SIG '@' mentions and adds 'sig/*' and 'kind/*' labels as appropriate.
Package sigmention recognize SIG '@' mentions and adds 'sig/*' and 'kind/*' labels as appropriate.
Package size contains a Prow plugin which counts the number of lines changed in a pull request, buckets this number into a few size classes (S, L, XL, etc), and finally labels the pull request with this size.
Package size contains a Prow plugin which counts the number of lines changed in a pull request, buckets this number into a few size classes (S, L, XL, etc), and finally labels the pull request with this size.
Package skip implements the `/skip` command which allows users to clean up commit statuses of non-blocking presubmits on PRs.
Package skip implements the `/skip` command which allows users to clean up commit statuses of non-blocking presubmits on PRs.
Package stage defines a Prow plugin that defines the stage of the issue in the features process.
Package stage defines a Prow plugin that defines the stage of the issue in the features process.
Package welcome implements a prow plugin to welcome new contributors
Package welcome implements a prow plugin to welcome new contributors
Package wip will label a PR a work-in-progress if the author provides a prefix to their pull request title to the same effect.
Package wip will label a PR a work-in-progress if the author provides a prefix to their pull request title to the same effect.

Jump to

Keyboard shortcuts

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