plugins

package
v0.0.0-...-6877637 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 40 Imported by: 83

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 = "" /* 344-byte string literal not displayed */

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

View Source
const BugzillaOptionsWildcard = `*`

Variables

View Source
var (

	// CommentMap is used by many plugins for printing help messages defined in
	// config.go.
	CommentMap, _ = genyaml.NewCommentMap(nil)
)

Functions

func EventsForPlugin

func EventsForPlugin(name string) []string

EventsForPlugin returns the registered events for the passed plugin.

func FormatICResponse

func FormatICResponse(ic github.IssueComment, 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(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 RegisterGenericCommentHandler

func RegisterGenericCommentHandler(name string, fn GenericCommentHandler, help HelpProvider)

RegisterGenericCommentHandler registers a plugin's github.GenericCommentEvent handler.

func RegisterIssueCommentHandler

func RegisterIssueCommentHandler(name string, fn IssueCommentHandler, help HelpProvider)

RegisterIssueCommentHandler registers a plugin's github.IssueCommentEvent handler.

func RegisterIssueHandler

func RegisterIssueHandler(name string, fn IssueHandler, help HelpProvider)

RegisterIssueHandler registers a plugin's github.IssueEvent handler.

func RegisterPullRequestHandler

func RegisterPullRequestHandler(name string, fn PullRequestHandler, help HelpProvider)

RegisterPullRequestHandler registers a plugin's github.PullRequestEvent handler.

func RegisterPushEventHandler

func RegisterPushEventHandler(name string, fn PushEventHandler, help HelpProvider)

RegisterPushEventHandler registers a plugin's github.PushEvent handler.

func RegisterReviewCommentEventHandler

func RegisterReviewCommentEventHandler(name string, fn ReviewCommentEventHandler, help HelpProvider)

RegisterReviewCommentEventHandler registers a plugin's github.ReviewCommentEvent handler.

func RegisterReviewEventHandler

func RegisterReviewEventHandler(name string, fn ReviewEventHandler, help HelpProvider)

RegisterReviewEventHandler registers a plugin's github.ReviewEvent handler.

func RegisterStatusEventHandler

func RegisterStatusEventHandler(name string, fn StatusEventHandler, help HelpProvider)

RegisterStatusEventHandler registers a plugin's github.StatusEvent handler.

Types

type Agent

type Agent struct {
	GitHubClient              PluginGitHubClient
	ProwJobClient             prowv1.ProwJobInterface
	KubernetesClient          kubernetes.Interface
	BuildClusterCoreV1Clients map[string]corev1.CoreV1Interface
	GitClient                 git.ClientFactory
	SlackClient               *slack.Client
	BugzillaClient            bugzilla.Client
	JiraClient                jira.Client

	OwnersClient repoowners.Interface

	// Metrics exposes metrics that can be updated by plugins
	Metrics *Metrics

	// 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
	// contains filtered or unexported fields
}

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

func NewAgent

func NewAgent(configAgent *config.Agent, pluginConfigAgent *ConfigAgent, clientAgent *ClientAgent, githubOrg string, metrics *Metrics, logger *logrus.Entry, plugin string) Agent

NewAgent bootstraps a new config.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.

func (*Agent) TookAction

func (a *Agent) TookAction() bool

TookAction indicates whether any client with implemented Used() function was used

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 disables automatic approval from PR authors with approval rights.
	// Otherwise the plugin assumes the author of the PR with approval rights 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"`
	// CommandHelpLink is the link to the help page which shows the available commands for each repo.
	// The default value is "https://go.k8s.io/bot-commands". The command help page is served by Deck
	// and available under https://<deck-url>/command-help, e.g. "https://prow.k8s.io/command-help"
	CommandHelpLink string `json:"commandHelpLink"`
	// PrProcessLink is the link to the help page which explains the code review process.
	// The default value is "https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process".
	PrProcessLink string `json:"pr_process_link,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

func (Approve) HasSelfApproval

func (a Approve) HasSelfApproval() bool

type AssignOnLabel

type AssignOnLabel struct {
	Label string `json:"label"`
}

AssignOnLabel specifies the label that would trigger the RestrictedLabel.AllowedUsers' to be assigned on the PR.

type Blockade

type Blockade struct {
	// Repos are either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// BranchRegexp is the regular expression for branches that the blockade applies to.
	// If BranchRegexp is not specified, the blockade applies to all branches by default.
	// Compiles into BranchRe during config load.
	BranchRegexp *string        `json:"branchregexp,omitempty"`
	BranchRe     *regexp.Regexp `json:"-"`
	// 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 Blunderbuss

type Blunderbuss struct {
	// ReviewerCount is the minimum number of reviewers to request
	// reviews from. Defaults to requesting reviews from 2 reviewers
	ReviewerCount *int `json:"request_count,omitempty"`
	// MaxReviewerCount is the maximum number of reviewers to request
	// reviews from. Defaults to 0 meaning no limit.
	MaxReviewerCount int `json:"max_request_count,omitempty"`
	// ExcludeApprovers controls whether approvers are considered to be
	// reviewers. By default, approvers are considered as reviewers if
	// insufficient reviewers are available. If ExcludeApprovers is true,
	// approvers will never be considered as reviewers.
	ExcludeApprovers bool `json:"exclude_approvers,omitempty"`
	// UseStatusAvailability controls whether blunderbuss will consider GitHub's
	// status availability when requesting reviews for users. This will use at one
	// additional token per successful reviewer (and potentially more depending on
	// how many busy reviewers it had to pass over).
	UseStatusAvailability bool `json:"use_status_availability,omitempty"`
	// IgnoreDrafts instructs the plugin to ignore assigning reviewers
	// to the PR that is in Draft state. Default it's false.
	IgnoreDrafts bool `json:"ignore_drafts,omitempty"`
	// IgnoreAuthors skips requesting reviewers for specified users.
	// This is useful when a bot user or admin opens a PR that will be
	// merged regardless of approvals.
	IgnoreAuthors []string `json:"ignore_authors,omitempty"`
}

Blunderbuss defines configuration for the blunderbuss plugin.

type BranchCleaner

type BranchCleaner struct {
	// PreservedBranches is a map of org/repo branches
	// format:
	// “`
	// preserved_branches:
	//   <org>: ["master", "release"]
	//   <org/repo>: ["master", "release"]
	// “`
	// branches in this allow map would be exempt from branch gc
	// even if the branches are already merged into the target branch
	PreservedBranches map[string][]string `json:"preserved_branches,omitempty"`
}

BranchCleaner contains the configuration for the branchcleaner plugin.

func (*BranchCleaner) IsPreservedBranch

func (b *BranchCleaner) IsPreservedBranch(org, repo, branch string) bool

IsPreservedBranch check if the branch is in the preserved branch list or not.

type BranchToMilestone

type BranchToMilestone map[string]string

BranchToMilestone is a map of the branch name to the configured milestone for that branch. This is used by the milestoneapplier plugin.

type Bugzilla

type Bugzilla struct {
	// Default settings mapped by branch in any repo in any org.
	// The `*` wildcard will apply to all branches.
	Default map[string]BugzillaBranchOptions `json:"default,omitempty"`
	// Options for specific orgs. The `*` wildcard will apply to all orgs.
	Orgs map[string]BugzillaOrgOptions `json:"orgs,omitempty"`
}

Bugzilla holds options for checking Bugzilla bugs in a defaulting hierarchy.

func (*Bugzilla) OptionsForBranch

func (b *Bugzilla) OptionsForBranch(org, repo, branch string) BugzillaBranchOptions

OptionsForBranch determines the criteria for a valid Bugzilla bug on a branch of a repo by defaulting in a cascading way, in the following order (later entries override earlier ones), always searching for the wildcard as well as the branch name: global, then org, repo, and finally branch-specific configuration.

func (*Bugzilla) OptionsForRepo

func (b *Bugzilla) OptionsForRepo(org, repo string) map[string]BugzillaBranchOptions

OptionsForRepo determines the criteria for a valid Bugzilla bug on branches of a repo by defaulting in a cascading way, in the following order (later entries override earlier ones), always searching for the wildcard as well as the branch name: global, then org, repo, and finally branch-specific configuration.

type BugzillaBranchOptions

type BugzillaBranchOptions struct {
	// ExcludeDefaults excludes defaults from more generic Bugzilla configurations.
	ExcludeDefaults *bool `json:"exclude_defaults,omitempty"`

	// EnableBackporting enables functionality to create new backport bugs for
	// cherrypick PRs created by the cherrypick plugin that reference bugzilla bugs.
	EnableBackporting *bool `json:"enable_backporting,omitempty"`

	// ValidateByDefault determines whether a validation check is run for all pull
	// requests by default
	ValidateByDefault *bool `json:"validate_by_default,omitempty"`

	// IsOpen determines whether a bug needs to be open to be valid
	IsOpen *bool `json:"is_open,omitempty"`
	// TargetRelease determines which release a bug needs to target to be valid
	TargetRelease *string `json:"target_release,omitempty"`
	// Statuses determine which statuses a bug may have to be valid
	Statuses *[]string `json:"statuses,omitempty"`
	// ValidStates determine states in which the bug may be to be valid
	ValidStates *[]BugzillaBugState `json:"valid_states,omitempty"`

	// DependentBugStatuses determine which statuses a bug's dependent bugs may have
	// to deem the child bug valid.  These are merged into DependentBugStates when
	// resolving branch options.
	DependentBugStatuses *[]string `json:"dependent_bug_statuses,omitempty"`
	// DependentBugStates determine states in which a bug's dependents bugs may be
	// to deem the child bug valid.  If set, all blockers must have a valid state.
	DependentBugStates *[]BugzillaBugState `json:"dependent_bug_states,omitempty"`
	// DependentBugTargetReleases determines the set of valid target
	// releases for dependent bugs.  If set, all blockers must have a
	// valid target release.
	DependentBugTargetReleases *[]string `json:"dependent_bug_target_releases,omitempty"`
	// DeprecatedDependentBugTargetRelease determines which release a
	// bug's dependent bugs need to target to be valid.  If set, all
	// blockers must have a valid target releasee.
	//
	// Deprecated: Use DependentBugTargetReleases instead.  If set,
	// DependentBugTargetRelease will be appended to
	// DeprecatedDependentBugTargetReleases.
	DeprecatedDependentBugTargetRelease *string `json:"dependent_bug_target_release,omitempty"`

	// StatusAfterValidation is the status which the bug will be moved to after being
	// deemed valid and linked to a PR. Will implicitly be considered a part of `statuses`
	// if others are set.
	StatusAfterValidation *string `json:"status_after_validation,omitempty"`
	// StateAfterValidation is the state to which the bug will be moved after being
	// deemed valid and linked to a PR. Will implicitly be considered a part of `ValidStates`
	// if others are set.
	StateAfterValidation *BugzillaBugState `json:"state_after_validation,omitempty"`
	// AddExternalLink determines whether the pull request will be added to the Bugzilla
	// bug using the ExternalBug tracker API after being validated
	AddExternalLink *bool `json:"add_external_link,omitempty"`
	// StatusAfterMerge is the status which the bug will be moved to after all pull requests
	// in the external bug tracker have been merged.
	StatusAfterMerge *string `json:"status_after_merge,omitempty"`
	// StateAfterMerge is the state to which the bug will be moved after all pull requests
	// in the external bug tracker have been merged.
	StateAfterMerge *BugzillaBugState `json:"state_after_merge,omitempty"`
	// StateAfterClose is the state to which the bug will be moved if all pull requests
	// in the external bug tracker have been closed.
	StateAfterClose *BugzillaBugState `json:"state_after_close,omitempty"`

	// AllowedGroups is a list of bugzilla bug group names that the bugzilla plugin can
	// link to in PRs. If a bug is part of a group that is not in this list, the bugzilla
	// plugin will not link the bug to the PR.
	AllowedGroups []string `json:"allowed_groups,omitempty"`
}

BugzillaBranchOptions describes how to check if a Bugzilla bug is valid or not.

Note on `Status` vs `State` fields: `State` fields implement a superset of functionality provided by the `Status` fields and are meant to eventually supersede `Status` fields. Implementations using these structures should *only* use `Status` fields or only `States` fields, never both. The implementation mirrors `Status` fields into the matching `State` fields in the `ResolveBugzillaOptions` method to handle existing config, and is also able to sufficiently resolve the presence of both types of fields.

func OptionsForItem

func OptionsForItem(item string, config map[string]BugzillaBranchOptions) BugzillaBranchOptions

OptionsForItem resolves a set of options for an item, honoring the `*` wildcard and doing defaulting if it is present with the item itself.

func ResolveBugzillaOptions

func ResolveBugzillaOptions(parent, child BugzillaBranchOptions) BugzillaBranchOptions

ResolveBugzillaOptions implements defaulting for a parent/child configuration, preferring child fields where set. This method also reflects all "Status" fields into matching `State` fields.

type BugzillaBugState

type BugzillaBugState struct {
	Status     string `json:"status,omitempty"`
	Resolution string `json:"resolution,omitempty"`
}

BugzillaBugState describes bug states in the Bugzilla plugin config, used for example to specify states that bugs are supposed to be in or to which they should be made after some action.

func (*BugzillaBugState) AsBugUpdate

func (s *BugzillaBugState) AsBugUpdate(bug *bugzilla.Bug) *bugzilla.BugUpdate

AsBugUpdate returns a BugUpdate struct for updating a given to bug to the desired state. The returned struct will have only those fields set where the state differs from the parameter bug. If the bug state matches the desired state, returns nil. If the parameter bug is empty or a nil pointer, the returned BugUpdate will have all fields set that are set in the state.

func (*BugzillaBugState) Matches

func (s *BugzillaBugState) Matches(bug *bugzilla.Bug) bool

Matches returns whether a given bug matches the state

func (*BugzillaBugState) String

func (s *BugzillaBugState) String() string

String converts a Bugzilla state into human-readable description

type BugzillaBugStateSet

type BugzillaBugStateSet map[BugzillaBugState]interface{}

func NewBugzillaBugStateSet

func NewBugzillaBugStateSet(states []BugzillaBugState) BugzillaBugStateSet

func (BugzillaBugStateSet) Has

func (BugzillaBugStateSet) Insert

type BugzillaOrgOptions

type BugzillaOrgOptions struct {
	// Default settings mapped by branch in any repo in this org.
	// The `*` wildcard will apply to all branches.
	Default map[string]BugzillaBranchOptions `json:"default,omitempty"`
	// Options for specific repos. The `*` wildcard will apply to all repos.
	Repos map[string]BugzillaRepoOptions `json:"repos,omitempty"`
}

BugzillaOrgOptions holds options for checking Bugzilla bugs for an org.

type BugzillaRepoOptions

type BugzillaRepoOptions struct {
	// Options for specific branches in this repo.
	// The `*` wildcard will apply to all branches.
	Branches map[string]BugzillaBranchOptions `json:"branches,omitempty"`
}

BugzillaRepoOptions holds options for checking Bugzilla bugs for a repo.

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 CherryPickApproved

type CherryPickApproved 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.
	Repo string `json:"repo,omitempty"`
	// 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:"-"`
	// Approvers is the list of GitHub logins allowed to approve a cherry-pick.
	Approvers []string `json:"approvers,omitempty"`
	// AllowMissingApprovedLabel allows approving cherry-pick without the approved label.
	AllowMissingApprovedLabel bool `json:"allow_missing_approved_label,omitempty"`
	// AllowMissingLGTMLabel allows approving cherry-pick without the lgtm label.
	AllowMissingLGTMLabel bool `json:"allow_missing_lgtm_label,omitempty"`
}

CherryPickApproved is the config for the cherrypick-approved 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 {
	GitHubClient              github.Client
	ProwJobClient             prowv1.ProwJobInterface
	KubernetesClient          kubernetes.Interface
	BuildClusterCoreV1Clients map[string]corev1.CoreV1Interface
	GitClient                 git.ClientFactory
	SlackClient               *slack.Client
	OwnersClient              repoowners.Interface
	BugzillaClient            bugzilla.Client
	JiraClient                jira.Client
}

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

type ClusterGroup

type ClusterGroup struct {
	Clusters   []string `json:"clusters,omitempty"`
	Namespaces []string `json:"namespaces,omitempty"`
}

A ClusterGroup is a list of clusters with namespaces

type ConfigAgent

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

ConfigAgent contains the agent mutex and the Agent configuration.

func NewFakeConfigAgent

func NewFakeConfigAgent() ConfigAgent

func (*ConfigAgent) Config

func (pa *ConfigAgent) Config() *Configuration

Config returns the agent current Configuration.

func (*ConfigAgent) GenericCommentHandlers

func (pa *ConfigAgent) GenericCommentHandlers(owner, repo string) map[string]GenericCommentHandler

GenericCommentHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) IssueCommentHandlers

func (pa *ConfigAgent) IssueCommentHandlers(owner, repo string) map[string]IssueCommentHandler

IssueCommentHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) IssueHandlers

func (pa *ConfigAgent) IssueHandlers(owner, repo string) map[string]IssueHandler

IssueHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) Load

func (pa *ConfigAgent) Load(path string, supplementalPluginConfigDirs []string, supplementalPluginConfigFileSuffix string, checkUnknownPlugins, skipResolveConfigUpdater bool) 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. If checkUnknownPlugins is true, unrecognized plugin names will make config loading fail. If skipResolveConfigUpdater is true, the ConfigUpdater of the config will not be resolved.

func (*ConfigAgent) PullRequestHandlers

func (pa *ConfigAgent) PullRequestHandlers(owner, repo string) map[string]PullRequestHandler

PullRequestHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) PushEventHandlers

func (pa *ConfigAgent) PushEventHandlers(owner, repo string) map[string]PushEventHandler

PushEventHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) ReviewCommentEventHandlers

func (pa *ConfigAgent) ReviewCommentEventHandlers(owner, repo string) map[string]ReviewCommentEventHandler

ReviewCommentEventHandlers returns a map of plugin names to handlers for the repo.

func (*ConfigAgent) ReviewEventHandlers

func (pa *ConfigAgent) ReviewEventHandlers(owner, repo string) map[string]ReviewEventHandler

ReviewEventHandlers returns a map of plugin names to handlers for the repo.

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.

func (*ConfigAgent) Start

func (pa *ConfigAgent) Start(path string, supplementalPluginConfigDirs []string, supplementalPluginConfigFileSuffix string, checkUnknownPlugins, skipResolveConfigUpdater bool) error

Start starts polling path for plugin config. If the first attempt fails, then start returns the error. Future errors will halt updates but not stop. If checkUnknownPlugins is true, unrecognized plugin names will make config loading fail.

func (*ConfigAgent) StatusEventHandlers

func (pa *ConfigAgent) StatusEventHandlers(owner, repo string) map[string]StatusEventHandler

StatusEventHandlers returns a map of plugin names to handlers for the repo.

type ConfigMapID

type ConfigMapID struct {
	Name, Namespace, Cluster string
}

ConfigMapID is a name/namespace/cluster combination that identifies a config map

type ConfigMapSpec

type ConfigMapSpec struct {
	// Name of ConfigMap
	Name string `json:"name"`
	// PartitionedNames is a slice of names of ConfigMaps that the keys should be balanced across.
	// This is useful when no explicit key is given and file names/paths are used as keys instead.
	// This is used to work around the 1MB ConfigMap size limit by spreading the keys across multiple
	// separate ConfigMaps.
	// PartitionedNames is mutually exclusive with the "Name" field.
	PartitionedNames []string `json:"partitioned_names,omitempty"`
	// 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 unless
	// use_full_path_as_key: true is set, in which case the full filepath relative
	// to the repository root will be used, replacing slashes with dashes.
	Key string `json:"key,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"`
	// Clusters is a map from cluster to namespaces
	// which specifies the targets the configMap needs to be deployed, i.e., each namespace in map[cluster]
	Clusters map[string][]string `json:"clusters,omitempty"`
	// ClusterGroup is a list of named cluster_groups to target. Mutually exclusive with clusters.
	ClusterGroups []string `json:"cluster_groups,omitempty"`
	// UseFullPathAsKey controls if the full path of the original file relative to the
	// repository root should be used as the configmap key. Slashes will be replaced by
	// dashes. Using this avoids the need for unique file names in the original repo.
	UseFullPathAsKey bool `json:"use_full_path_as_key,omitempty"`
}

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

type ConfigUpdater

type ConfigUpdater struct {
	// ClusterGroups is a map of ClusterGroups that can be used as a target
	// in the map config.
	ClusterGroups map[string]ClusterGroup `json:"cluster_groups,omitempty"`
	// 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 (cu *ConfigUpdater) SetDefaults()

SetDefaults sets default options for config updating

func (*ConfigUpdater) UnmarshalJSON

func (cu *ConfigUpdater) UnmarshalJSON(d []byte) error

type Configuration

type Configuration struct {
	// Plugins is a map of organizations (eg "o") or repositories
	// (eg "o/r") to lists of enabled plugin names.
	// If it is defined on both organization and repository levels, the list of enabled
	// plugin names for the repository is the merging list of the two levels.
	// You can find a comprehensive list of the default available plugins here
	// https://github.com/kubernetes-sigs/prow/tree/main/pkg/plugins
	// note that you're also able to add external plugins.
	Plugins Plugins `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"`
	Blunderbuss          Blunderbuss                  `json:"blunderbuss,omitempty"`
	Bugzilla             Bugzilla                     `json:"bugzilla,omitempty"`
	BranchCleaner        BranchCleaner                `json:"branch_cleaner,omitempty"`
	Cat                  Cat                          `json:"cat,omitempty"`
	CherryPickApproved   []CherryPickApproved         `json:"cherry_pick_approved,omitempty"`
	CherryPickUnapproved CherryPickUnapproved         `json:"cherry_pick_unapproved,omitempty"`
	ConfigUpdater        ConfigUpdater                `json:"config_updater,omitempty"`
	Dco                  map[string]*Dco              `json:"dco,omitempty"`
	Golint               Golint                       `json:"golint,omitempty"`
	Goose                Goose                        `json:"goose,omitempty"`
	Heart                Heart                        `json:"heart,omitempty"`
	Label                Label                        `json:"label,omitempty"`
	Lgtm                 []Lgtm                       `json:"lgtm,omitempty"`
	Jira                 *Jira                        `json:"jira,omitempty"`
	MilestoneApplier     map[string]BranchToMilestone `json:"milestone_applier,omitempty"`
	RepoMilestone        map[string]Milestone         `json:"repo_milestone,omitempty"`
	Project              ProjectConfig                `json:"project_config,omitempty"`
	ProjectManager       ProjectManager               `json:"project_manager,omitempty"`
	RequireMatchingLabel []RequireMatchingLabel       `json:"require_matching_label,omitempty"`
	Retitle              Retitle                      `json:"retitle,omitempty"`
	Slack                Slack                        `json:"slack,omitempty"`
	SigMention           SigMention                   `json:"sigmention,omitempty"`
	Size                 Size                         `json:"size,omitempty"`
	Triggers             []Trigger                    `json:"triggers,omitempty"`
	Welcome              []Welcome                    `json:"welcome,omitempty"`
	Override             Override                     `json:"override,omitempty"`
	Help                 Help                         `json:"help,omitempty"`
}

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

func (*Configuration) ApproveFor

func (c *Configuration) ApproveFor(org, repo string) *Approve

ApproveFor finds the Approve for a repo, if one exists. Approval configuration can be listed for a repository or an organization.

func (*Configuration) DcoFor

func (c *Configuration) DcoFor(org, repo string) *Dco

DcoFor finds the Dco for a repo, if one exists a Dco can be listed for the repo itself or for the owning organization

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, orgExceptions map[string]sets.Set[string])

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

func (*Configuration) HasConfigFor

func (c *Configuration) HasConfigFor() (global bool, orgs sets.Set[string], repos sets.Set[string])

func (*Configuration) LgtmFor

func (c *Configuration) LgtmFor(org, repo string) *Lgtm

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

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) OwnersFilenames

func (c *Configuration) OwnersFilenames(org, repo string) ownersconfig.Filenames

OwnersFilenames determines which filenames to use for OWNERS and OWNERS_ALIASES for a repo.

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

func (*Configuration) ValidatePluginsUnknown

func (c *Configuration) ValidatePluginsUnknown() error

ValidatePluginsUnknown will return an error if there are any unrecognized plugins configured.

type Dco

type Dco struct {
	// SkipDCOCheckForMembers is used to skip DCO check for trusted org members
	SkipDCOCheckForMembers bool `json:"skip_dco_check_for_members,omitempty"`
	// TrustedApps defines list of apps which commits will not be checked for DCO singoff.
	// The list should contain usernames of each GitHub App without [bot] suffix.
	// By default, this option is ignored.
	TrustedApps []string `json:"trusted_apps,omitempty"`
	// TrustedOrg is the org whose members' commits will not be checked for DCO signoff
	// if the skip DCO option is enabled. The default is the PR's org.
	TrustedOrg string `json:"trusted_org,omitempty"`
	// SkipDCOCheckForCollaborators is used to skip DCO check for trusted org members
	SkipDCOCheckForCollaborators bool `json:"skip_dco_check_for_collaborators,omitempty"`
	// ContributingRepo is used to point users to a different repo containing CONTRIBUTING.md
	ContributingRepo string `json:"contributing_repo,omitempty"`
	// ContributingBranch allows setting a custom branch where to find CONTRIBUTING.md
	ContributingBranch string `json:"contributing_branch,omitempty"`
	// ContributingPath is used to override the default path to CONTRIBUTING.md
	ContributingPath string `json:"contributing_path,omitempty"`
}

Dco is config for the DCO (https://developercertificate.org/) checker plugin.

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, github.GenericCommentEvent) error

GenericCommentHandler defines the function contract for a github.GenericCommentEvent handler.

type Golint

type Golint struct {
	// MinimumConfidence is the smallest permissible confidence
	// in (0,1] over which problems will be printed. Defaults to
	// 0.8, as does the `go lint` tool.
	MinimumConfidence *float64 `json:"minimum_confidence,omitempty"`
}

Golint holds configuration for the golint plugin

type Goose

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

Goose contains the configuration for the goose plugin.

type Heart

type Heart struct {
	// Adorees is a list of GitHub logins for members
	// for whom we will add emojis to comments
	Adorees []string `json:"adorees,omitempty"`
	// CommentRegexp is the regular expression for comments
	// made by adorees that the plugin adds emojis to.
	// If not specified, the plugin will not add emojis to
	// any comments.
	// Compiles into CommentRe during config load.
	CommentRegexp string         `json:"commentregexp,omitempty"`
	CommentRe     *regexp.Regexp `json:"-"`
}

Heart contains the configuration for the heart plugin.

type Help

type Help struct {
	// HelpGuidelinesURL is the URL of the help page, which provides guidance on how and when to use the help wanted and good first issue labels.
	// The default value is "https://git.k8s.io/community/contributors/guide/help-wanted.md".
	HelpGuidelinesURL string `json:"help_guidelines_url,omitempty"`
	// Guidelines summary is the message displayed when an issue is labeled with help-wanted and/or good-first-issue reflecting
	// a summary of the guidelines that an issue should follow to qualify as help-wanted or good-first-issue. The main purpose
	// of a summary is to try and increase visibility of these guidelines to the author of the issue alongisde providing the
	// HelpGuidelinesURL which will provide a more detailed version of the guidelines.
	//
	// HelpGuidelinesSummary is the summary of the guide lines for a help-wanted issue.
	HelpGuidelinesSummary string `json:"help_guidelines_summary,omitempty"`
}

type HelpProvider

type HelpProvider func(config *Configuration, enabledRepos []config.OrgRepo) (*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 IssueCommentHandler

type IssueCommentHandler func(Agent, github.IssueCommentEvent) error

IssueCommentHandler defines the function contract for a github.IssueCommentEvent handler.

type IssueHandler

type IssueHandler func(Agent, github.IssueEvent) error

IssueHandler defines the function contract for a github.IssueEvent handler.

type Jira

type Jira struct {
	// DisabledJiraProjects are projects for which we will never try to create a link,
	// for example including `enterprise` here would disable linking for all issues
	// that start with `enterprise-` like `enterprise-4.` Matching is case-insenitive.
	DisabledJiraProjects []string `json:"disabled_jira_projects,omitempty"`
}

Jira holds the config for the jira plugin.

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,omitempty"`

	// RestrictedLabels allows to configure labels that can only be modified
	// by users that belong to at least one of the configured teams. The key
	// defines to which repos this applies and can be `*` for global, an org
	// or a repo in org/repo notation.
	RestrictedLabels map[string][]RestrictedLabel `json:"restricted_labels,omitempty"`
}

Label contains the configuration for the label plugin.

func (Label) IsRestrictedLabelInAdditionalLabels

func (l Label) IsRestrictedLabelInAdditionalLabels(restricted string) bool

func (Label) RestrictedLabelsFor

func (l Label) RestrictedLabelsFor(org, repo string) map[string]RestrictedLabel

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 ListableRepos

type ListableRepos interface {
	// contains filtered or unexported methods
}

type ManagedColumn

type ManagedColumn struct {
	// Either of ID or Name should be specified
	ID   *int   `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	// State must be open, closed or all
	State string `json:"state,omitempty"`
	// all the labels here should match to the incoming event to be bale to add the card to the project
	Labels []string `json:"labels,omitempty"`
	// Configuration is effective is the issue events repo/Owner/Login matched the org
	Org string `json:"org,omitempty"`
}

ManagedColumn is used by the ProjectQueries plugin to represent a project column and the conditions to add a PR to that column

type ManagedOrgRepo

type ManagedOrgRepo struct {
	Projects map[string]ManagedProject `json:"projects,omitempty"`
}

ManagedOrgRepo is used by the ProjectManager plugin to represent an Organisation or Repository with a list of Projects

type ManagedProject

type ManagedProject struct {
	Columns []ManagedColumn `json:"columns,omitempty"`
}

ManagedProject is used by the ProjectManager plugin to represent a Project with a list of Columns

type MergeWarning

type MergeWarning struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,omitempty"`
	// List of channels on which a event is published.
	Channels []string `json:"channels,omitempty"`
	// A slack event is published if the user is not part of the ExemptUsers.
	ExemptUsers []string `json:"exempt_users,omitempty"`
	// A slack event is published if the user is not on the exempt branches.
	ExemptBranches map[string][]string `json:"exempt_branches,omitempty"`
}

MergeWarning is a config for the slackevents plugin's manual merge warnings. If a PR is pushed to any of the repos listed in the config then send messages to the all the slack channels listed if pusher is NOT in the allowlist.

type Metrics

type Metrics struct {
	ConfigMapGauges *prometheus.GaugeVec
}

Metrics is a set of metrics that are gathered by plugins. It is up the consumers of these metrics to ensure that they update the values in a thread-safe manner.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics returns a reference to the metrics plugins manage

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 github ID of your team
	// responsible for maintaining the milestones:
	// curl -H "Authorization: token <token>" https://api.github.com/orgs/<org-name>/teams
	// Deprecated: use MaintainersTeam instead
	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 OrgPlugins

type OrgPlugins struct {
	ExcludedRepos []string `json:"excluded_repos,omitempty"`
	Plugins       []string `json:"plugins,omitempty"`
}

type Override

type Override struct {
	AllowTopLevelOwners bool `json:"allow_top_level_owners,omitempty"`
	// AllowedGitHubTeams is a map of orgs and/or repositories (eg "org" or "org/repo") to list of GitHub team slugs,
	// members of which are allowed to override contexts
	AllowedGitHubTeams map[string][]string `json:"allowed_github_teams,omitempty"`
}

Override holds options for the override plugin

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"`

	// LabelsDenyList 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.
	LabelsDenyList []string `json:"labels_denylist,omitempty"`

	// Filenames allows configuring repos to use a separate set of filenames for
	// any plugin that interacts with these files. Keys are in "org" or "org/repo" format.
	Filenames map[string]ownersconfig.Filenames `json:"filenames,omitempty"`
}

Owners contains configuration related to handling OWNERS files.

type PluginGitHubClient

type PluginGitHubClient interface {
	github.Client
	Query(ctx context.Context, q interface{}, vars map[string]interface{}) error
}

type Plugins

type Plugins map[string]OrgPlugins

Plugins maps orgOrRepo to plugins

func OldToNewPlugins

func OldToNewPlugins(oldPlugins map[string][]string) Plugins

func (*Plugins) UnmarshalJSON

func (p *Plugins) UnmarshalJSON(d []byte) error

type ProjectConfig

type ProjectConfig struct {
	// Org level configs for github projects; key is org name
	Orgs map[string]ProjectOrgConfig `json:"project_org_configs,omitempty"`
}

ProjectConfig contains the configuration options for the project plugin

func (*ProjectConfig) GetColumnMap

func (pluginConfig *ProjectConfig) GetColumnMap(org string, repo string) map[string]string

func (*ProjectConfig) GetMaintainerTeam

func (pluginConfig *ProjectConfig) GetMaintainerTeam(org string, repo string) int

func (*ProjectConfig) GetOrgColumnMap

func (pluginConfig *ProjectConfig) GetOrgColumnMap(org string) map[string]string

type ProjectManager

type ProjectManager struct {
	OrgRepos map[string]ManagedOrgRepo `json:"orgsRepos,omitempty"`
}

ProjectManager represents the config for the ProjectManager plugin, holding top level config options, configuration is a hierarchial structure with top level element being org or org/repo with the list of projects as its children

type ProjectOrgConfig

type ProjectOrgConfig struct {
	// ID of the github project maintainer team for a give project or org
	MaintainerTeamID int `json:"org_maintainers_team_id,omitempty"`
	// A map of project name to default column; an issue/PR will be added
	// to the default column if column name is not provided in the command
	ProjectColumnMap map[string]string `json:"org_default_column_map,omitempty"`
	// Repo level configs for github projects; key is repo name
	Repos map[string]ProjectRepoConfig `json:"project_repo_configs,omitempty"`
}

ProjectOrgConfig holds the github project config for an entire org. This can be overridden by ProjectRepoConfig.

type ProjectRepoConfig

type ProjectRepoConfig struct {
	// ID of the github project maintainer team for a give project or org
	MaintainerTeamID int `json:"repo_maintainers_team_id,omitempty"`
	// A map of project name to default column; an issue/PR will be added
	// to the default column if column name is not provided in the command
	ProjectColumnMap map[string]string `json:"repo_default_column_map,omitempty"`
}

ProjectRepoConfig holds the github project config for a github project.

type PullRequestHandler

type PullRequestHandler func(Agent, github.PullRequestEvent) error

PullRequestHandler defines the function contract for a github.PullRequestEvent handler.

type PushEventHandler

type PushEventHandler func(Agent, github.PushEvent) error

PushEventHandler defines the function contract for a github.PushEvent 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 RestrictedLabel

type RestrictedLabel struct {
	Label        string          `json:"label"`
	AllowedTeams []string        `json:"allowed_teams,omitempty"`
	AllowedUsers []string        `json:"allowed_users,omitempty"`
	AssignOn     []AssignOnLabel `json:"assign_on,omitempty"`
}

type Retitle

type Retitle struct {
	// AllowClosedIssues allows retitling closed/merged issues and PRs.
	AllowClosedIssues bool `json:"allow_closed_issues,omitempty"`
}

Retitle specifies configuration for the retitle plugin.

type ReviewCommentEventHandler

type ReviewCommentEventHandler func(Agent, github.ReviewCommentEvent) error

ReviewCommentEventHandler defines the function contract for a github.ReviewCommentEvent handler.

type ReviewEventHandler

type ReviewEventHandler func(Agent, github.ReviewEvent) error

ReviewEventHandler defines the function contract for a github.ReviewEvent 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 Slack

type Slack struct {
	MentionChannels []string       `json:"mentionchannels,omitempty"`
	MergeWarnings   []MergeWarning `json:"mergewarnings,omitempty"`
}

Slack contains the configuration for the slack plugin.

type StatusEventHandler

type StatusEventHandler func(Agent, github.StatusEvent) error

StatusEventHandler defines the function contract for a github.StatusEvent handler.

type Trigger

type Trigger struct {
	// Repos is either of the form org/repos or just org.
	Repos []string `json:"repos,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"`
	// TrustedOrg is the org whose members' PRs will be automatically built for
	// PRs to the above repos. The default is the PR's org.
	//
	// Deprecated: TrustedOrg functionality is deprecated and will be removed in
	// January 2020.
	TrustedOrg string `json:"trusted_org,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"`
	// TriggerGitHubWorkflows enables workflows run by github to be triggered by prow.
	TriggerGitHubWorkflows bool `json:"trigger_github_workflows,omitempty"`
}

Trigger specifies a configuration for a single trigger.

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

func (*Trigger) SetDefaults

func (t *Trigger) SetDefaults()

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"`
	// Post welcome message in all cases, even if PR author is not an existing
	// contributor or part of the organization
	AlwaysPost bool `json:"always_post,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 bugzilla ensures that pull requests reference a Bugzilla bug in their title
Package bugzilla ensures that pull requests reference a Bugzilla bug in their title
Package buildifier defines a Prow plugin that runs buildifier over modified BUILD, WORKSPACE, and skylark (.bzl) files in pull requests.
Package buildifier defines a Prow plugin that runs buildifier over modified BUILD, WORKSPACE, and skylark (.bzl) files in pull requests.
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
cherrypickapprovedfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
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 dco implements a DCO (https://developercertificate.org/) checker plugin
Package dco implements a DCO (https://developercertificate.org/) checker plugin
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 goose adds goose images to an issue or PR in response to a /honk comment
Package goose adds goose images to an issue or PR in response to a /honk 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 invalidcommitmsg adds the "do-not-merge/invalid-commit-message" label on PRs containing commit messages with @mentions or keywords that can automatically close issues.
Package invalidcommitmsg adds the "do-not-merge/invalid-commit-message" label on PRs containing commit messages with @mentions or keywords that can automatically close issues.
Package lgtm implements the lgtm plugin
Package lgtm implements the lgtm plugin
Package mergemethodcomment contains a Prow plugin which comments on PRs with 2 or more commits, informing the user: - How to request commits to be squashed if default merge method is merge, - How to request commits to be merged if the repo squashes commits by default, - That the commits will be merged/squashed if it is not possible to override the default merge method.
Package mergemethodcomment contains a Prow plugin which comments on PRs with 2 or more commits, informing the user: - How to request commits to be squashed if default merge method is merge, - How to request commits to be merged if the repo squashes commits by default, - That the commits will be merged/squashed if it is not possible to override the default merge method.
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 milestoneapplier implements the plugin to automatically apply the configured milestone after a PR is merged.
Package milestoneapplier implements the plugin to automatically apply the configured milestone after a PR is merged.
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 project implements the `/project` command which allows members of the project maintainers team to specify a project to be applied to an Issue or PR.
Package project implements the `/project` command which allows members of the project maintainers team to specify a project to be applied to an Issue or PR.
Package projectmanager is a plugin to auto add pull requests to project boards based on specified conditions
Package projectmanager is a plugin to auto add pull requests to project boards based on specified conditions
Package requirematchinglabel implements the `require-matching-label` plugin.
Package requirematchinglabel implements the `require-matching-label` plugin.
Package retitle implements the retitle plugin
Package retitle implements the retitle plugin
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.
checker/checkerfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
testfreezefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
Package transferissue implements the `/transfer-issue` command which allows members of the org to transfer issues between repos
Package transferissue implements the `/transfer-issue` command which allows members of the org to transfer issues between repos
Package trickortreat adds halloween images to an issue or PR in response to a /trick-or-treat comment
Package trickortreat adds halloween images to an issue or PR in response to a /trick-or-treat comment
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