Documentation ¶
Index ¶
- Constants
- func EventsForPlugin(name string) []string
- func FormatICResponse(ic scm.Comment, s string) string
- func FormatResponse(to, message, reason string) string
- func FormatResponseRaw(body, bodyURL, login, reply string) string
- func FormatSimpleResponse(to, message string) string
- func HelpProviders() map[string]HelpProvider
- func RegisterGenericCommentHandler(name string, fn GenericCommentHandler, help HelpProvider)
- func RegisterIssueCommentHandler(name string, fn IssueCommentHandler, help HelpProvider)
- func RegisterIssueHandler(name string, fn IssueHandler, help HelpProvider)
- func RegisterPullRequestHandler(name string, fn PullRequestHandler, help HelpProvider)
- func RegisterPushEventHandler(name string, fn PushEventHandler, help HelpProvider)
- func RegisterReviewCommentEventHandler(name string, fn ReviewCommentEventHandler, help HelpProvider)
- func RegisterReviewEventHandler(name string, fn ReviewEventHandler, help HelpProvider)
- func RegisterStatusEventHandler(name string, fn StatusEventHandler, help HelpProvider)
- type Agent
- type Approve
- type Blockade
- type Blunderbuss
- type Cat
- type CherryPickUnapproved
- type ClientAgent
- type ConfigAgent
- func (pa *ConfigAgent) Config() *Configuration
- func (pa *ConfigAgent) GenericCommentHandlers(owner, repo string) map[string]GenericCommentHandler
- func (pa *ConfigAgent) IssueCommentHandlers(owner, repo string) map[string]IssueCommentHandler
- func (pa *ConfigAgent) IssueHandlers(owner, repo string) map[string]IssueHandler
- func (pa *ConfigAgent) Load(path string) error
- func (pa *ConfigAgent) LoadYAMLConfig(data []byte) (*Configuration, error)
- func (pa *ConfigAgent) PullRequestHandlers(owner, repo string) map[string]PullRequestHandler
- func (pa *ConfigAgent) PushEventHandlers(owner, repo string) map[string]PushEventHandler
- func (pa *ConfigAgent) ReviewCommentEventHandlers(owner, repo string) map[string]ReviewCommentEventHandler
- func (pa *ConfigAgent) ReviewEventHandlers(owner, repo string) map[string]ReviewEventHandler
- func (pa *ConfigAgent) Set(pc *Configuration)
- func (pa *ConfigAgent) Start(path string) error
- func (pa *ConfigAgent) StatusEventHandlers(owner, repo string) map[string]StatusEventHandler
- type ConfigMapSpec
- type ConfigUpdate
- type Configuration
- type ExternalPlugin
- type GenericCommentHandler
- type Golint
- type Heart
- type HelpProvider
- type IssueCommentHandler
- type IssueHandler
- type Label
- type Lgtm
- type MergeWarning
- type Milestone
- type Owners
- type PullRequestHandler
- type PushEventHandler
- type RequireMatchingLabel
- type RequireSIG
- type ReviewCommentEventHandler
- type ReviewEventHandler
- type SigMention
- type Size
- type Slack
- type StatusEventHandler
- type Trigger
- type Welcome
Constants ¶
const AboutThisBot = AboutThisBotWithoutCommands + " " + AboutThisBotCommands
AboutThisBot contains the text of both AboutThisBotWithoutCommands and AboutThisBotCommands.
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.
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 EventsForPlugin ¶
EventsForPlugin returns the registered events for the passed plugin.
func FormatICResponse ¶
FormatICResponse nicely formats a response to an issue comment.
func FormatResponse ¶
FormatResponse nicely formats a response to a generic reason.
func FormatResponseRaw ¶
FormatResponseRaw nicely formats a response for one does not have an issue comment
func FormatSimpleResponse ¶
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 scm.Comment handler.
func RegisterIssueCommentHandler ¶
func RegisterIssueCommentHandler(name string, fn IssueCommentHandler, help HelpProvider)
RegisterIssueCommentHandler registers a plugin's scm.Comment handler.
func RegisterIssueHandler ¶
func RegisterIssueHandler(name string, fn IssueHandler, help HelpProvider)
RegisterIssueHandler registers a plugin's scm.Issue handler.
func RegisterPullRequestHandler ¶
func RegisterPullRequestHandler(name string, fn PullRequestHandler, help HelpProvider)
RegisterPullRequestHandler registers a plugin's scm.PullRequest handler.
func RegisterPushEventHandler ¶
func RegisterPushEventHandler(name string, fn PushEventHandler, help HelpProvider)
RegisterPushEventHandler registers a plugin's scm.PushHook handler.
func RegisterReviewCommentEventHandler ¶
func RegisterReviewCommentEventHandler(name string, fn ReviewCommentEventHandler, help HelpProvider)
RegisterReviewCommentEventHandler registers a plugin's scm.PullRequestCommentHook handler.
func RegisterReviewEventHandler ¶
func RegisterReviewEventHandler(name string, fn ReviewEventHandler, help HelpProvider)
RegisterReviewEventHandler registers a plugin's ReviewHook handler.
func RegisterStatusEventHandler ¶
func RegisterStatusEventHandler(name string, fn StatusEventHandler, help HelpProvider)
RegisterStatusEventHandler registers a plugin's scm.Status handler.
Types ¶
type Agent ¶
type Agent struct { SCMProviderClient *scmprovider.Client LauncherClient launcher.PipelineLauncher GitClient git2.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 // 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, 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 ¶
InitializeCommentPruner attaches a commentpruner.EventClient to the agent to handle pruning comments.
type Blunderbuss ¶
type Blunderbuss = plugins.Blunderbuss
Blunderbuss is an alias to the type in lighthouse-config
type CherryPickUnapproved ¶
type CherryPickUnapproved = plugins.CherryPickUnapproved
CherryPickUnapproved is an alias to the type in lighthouse-config
type ClientAgent ¶
type ClientAgent struct { BotName string SCMProviderClient *scm.Client KubernetesClient kubernetes.Interface GitClient git2.Client LauncherClient launcher.PipelineLauncher LighthouseClient lighthouseclient.LighthouseJobInterface }
ClientAgent contains the various clients that are attached to the Agent.
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) 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) 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) 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) 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.
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 ConfigMapSpec ¶
type ConfigMapSpec = plugins.ConfigMapSpec
ConfigMapSpec is an alias to the type in lighthouse-config
type ConfigUpdate ¶ added in v0.0.661
type ConfigUpdate = plugins.ConfigUpdater
ConfigUpdate is an alias to the type in lighthouse-config
type Configuration ¶
type Configuration = plugins.Configuration
Configuration is an alias to the configuration type in lighthouse-config
type ExternalPlugin ¶
type ExternalPlugin = plugins.ExternalPlugin
ExternalPlugin is an alias to the type in lighthouse-config
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 IssueCommentHandler ¶
type IssueCommentHandler func(Agent, scm.IssueCommentHook) error
IssueCommentHandler defines the function contract for a scm.Comment handler.
type IssueHandler ¶
IssueHandler defines the function contract for a scm.Issue handler.
type MergeWarning ¶
type MergeWarning = plugins.MergeWarning
MergeWarning is an alias to the type in lighthouse-config
type PullRequestHandler ¶
type PullRequestHandler func(Agent, scm.PullRequestHook) error
PullRequestHandler defines the function contract for a scm.PullRequest handler.
type PushEventHandler ¶
PushEventHandler defines the function contract for a scm.PushHook handler.
type RequireMatchingLabel ¶
type RequireMatchingLabel = plugins.RequireMatchingLabel
RequireMatchingLabel is an alias to the type in lighthouse-config
type RequireSIG ¶
type RequireSIG = plugins.RequireSIG
RequireSIG is an alias to the type in lighthouse-config
type ReviewCommentEventHandler ¶
type ReviewCommentEventHandler func(Agent, scm.PullRequestCommentHook) error
ReviewCommentEventHandler defines the function contract for a scm.PullRequestCommentHook handler.
type ReviewEventHandler ¶
type ReviewEventHandler func(Agent, scm.ReviewHook) error
ReviewEventHandler defines the function contract for a ReviewHook handler.
type SigMention ¶
type SigMention = plugins.SigMention
SigMention is an alias to the type in lighthouse-config
type StatusEventHandler ¶
StatusEventHandler defines the function contract for a scm.Status handler.
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. |