Repository: jenkins-x/lighthouse
Pull request #1027 (2020-09-09 15:33:05)

refactor: synthesize plugin help provider based on plugin definition
This PR uses plugin definition to synthesize plugin help provider.

The plugin definition is enough to synthesize the plugin provider help, no need for an help provider anymore.

jenkins-x-bot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **eddycharly**
You can assign the PR to them by writing `/assign @eddycharly` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=jenkins-x%2Flighthouse).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/jenkins-x/lighthouse/blob/master/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["eddycharly"]} -->
eddycharly: /hold

must come after https://github.com/jenkins-x/lighthouse/pull/1024
eddycharly: /hold cancel
jenkins-x-bot: @eddycharly: The following test **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
gitlab | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/5) | `/test gitlab`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @eddycharly: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
gitlab | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/5) | `/test gitlab`
github | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/3) | `/test github`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @eddycharly: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
gitlab | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/5) | `/test gitlab`
github | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/3) | `/test github`
ghe | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/2) | `/test ghe`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
jenkins-x-bot: @eddycharly: The following tests **failed**, say `/retest` to rerun them all:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
gitlab | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/5) | `/test gitlab`
github | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/3) | `/test github`
ghe | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/2) | `/test ghe`
bbs | f7be82b2d0732669d7907fb267e033628e91c662 | [link](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027/4) | `/test bbs`

[View all Builds for this Pull Request](https://dashboard-jx.jenkins-x.live/teams/jx/projects/jenkins-x/lighthouse/PR-1027) 

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [jenkins-x/lighthouse](https://github.com/jenkins-x/lighthouse/issues/new?title=Command%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
abayer: /lgtm
jenkins-x-bot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *[abayer](https://github.com/jenkins-x/lighthouse/pull/1027#issuecomment-689676547 "LGTM")*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=jenkins-x%2Flighthouse).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com#issuecomment-689676547/jenkins-x/lighthouse/blob/master/OWNERS)~~ [abayer]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/pkg/plugins/approve/approve.go b/pkg/plugins/approve/approve.go
index 9724a1c2..5c5def04 100644
--- a/pkg/plugins/approve/approve.go
+++ b/pkg/plugins/approve/approve.go
@@ -100,7 +100,7 @@ var (
 <br>
 <br>Per-repo configuration may be used to require that PRs link to an associated issue before approval is granted. It may also be used to specify that the PR authors implicitly approve their own PRs.
 <br>For more information see <a href="https://git.github.com/jenkins-x/lighthouse/pkg/prow/plugins/approve/approvers/README.md">here</a>.`,
-		HelpProvider:       helpProvider,
+		ConfigHelpProvider: configHelp,
 		ReviewEventHandler: handleReviewEvent,
 		PullRequestHandler: handlePullRequestEvent,
 		Commands: []plugins.Command{{
@@ -123,7 +123,7 @@ func init() {
 	plugins.RegisterPlugin(PluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	doNot := func(b bool) string {
 		if b {
 			return ""
@@ -151,7 +151,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 		}
 		approveConfig[repo] = fmt.Sprintf("Pull requests %s require an associated issue.<br>Pull request authors %s implicitly approve their own PRs.<br>The /lgtm [cancel] command(s) %s act as approval.<br>A GitHub approved or changes requested review %s act as approval or cancel respectively.", doNot(opts.IssueRequired), doNot(opts.HasSelfApproval()), willNot(opts.LgtmActsAsApprove), willNot(opts.ConsiderReviewState()))
 	}
-	return &pluginhelp.PluginHelp{Config: approveConfig}, nil
+	return approveConfig, nil
 }
 
 func handleGenericCommentEvent(_ []string, pc plugins.Agent, ce scmprovider.GenericCommentEvent) error {
diff --git a/pkg/plugins/assign/assign.go b/pkg/plugins/assign/assign.go
index a732e85a..56d6ed94 100644
--- a/pkg/plugins/assign/assign.go
+++ b/pkg/plugins/assign/assign.go
@@ -39,8 +39,7 @@ var (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The assign plugin assigns or requests reviews from users. Specific users can be assigned with the command '/assign @user1' or have reviews requested of them with the command '/cc @user1'. If no user is specified the commands default to targeting the user who created the command. Assignments and requested reviews can be removed in the same way that they are added by prefixing the commands with 'un'.",
-		HelpProvider: helpProvider,
+		Description: "The assign plugin assigns or requests reviews from users. Specific users can be assigned with the command '/assign @user1' or have reviews requested of them with the command '/cc @user1'. If no user is specified the commands default to targeting the user who created the command. Assignments and requested reviews can be removed in the same way that they are added by prefixing the commands with 'un'.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -65,11 +64,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	AssignIssue(owner, repo string, number int, logins []string) error
 	UnassignIssue(owner, repo string, number int, logins []string) error
diff --git a/pkg/plugins/blockade/blockade.go b/pkg/plugins/blockade/blockade.go
index d34f1281..83d16742 100644
--- a/pkg/plugins/blockade/blockade.go
+++ b/pkg/plugins/blockade/blockade.go
@@ -31,7 +31,6 @@ import (
 
 	"github.com/jenkins-x/go-scm/scm"
 	"github.com/jenkins-x/lighthouse/pkg/labels"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 	"github.com/sirupsen/logrus"
 )
@@ -61,13 +60,13 @@ func init() {
 		PluginName,
 		plugins.Plugin{
 			Description:        "The blockade plugin blocks pull requests from merging if they touch specific files. The plugin applies the '" + labels.BlockedPaths + "' label to pull requests that touch files that match a blockade's block regular expression and none of the corresponding exception regular expressions.",
-			HelpProvider:       helpProvider,
+			ConfigHelpProvider: configHelp,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	// The {WhoCanUse, Usage, Examples} fields are omitted because this plugin cannot be triggered manually.
 	blockConfig := map[string]string{}
 	for _, repo := range enabledRepos {
@@ -85,7 +84,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 		}
 		blockConfig[repo] = buf.String()
 	}
-	return &pluginhelp.PluginHelp{Config: blockConfig}, nil
+	return blockConfig, nil
 }
 
 type blockCalc func([]*scm.Change, []blockade) summary
diff --git a/pkg/plugins/branchcleaner/branchcleaner.go b/pkg/plugins/branchcleaner/branchcleaner.go
index 5c459d6b..4868b7af 100644
--- a/pkg/plugins/branchcleaner/branchcleaner.go
+++ b/pkg/plugins/branchcleaner/branchcleaner.go
@@ -22,7 +22,6 @@ import (
 	"github.com/jenkins-x/go-scm/scm"
 	"github.com/sirupsen/logrus"
 
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 )
 
@@ -35,16 +34,11 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The branchcleaner plugin automatically deletes source branches for merged PRs between two branches on the same repository. This is helpful to keep repos that don't allow forking clean.",
-			HelpProvider:       helpProvider,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 func handlePullRequest(pc plugins.Agent, pre scm.PullRequestHook) error {
 	return handle(pc.SCMProviderClient, pc.Logger, pre)
 }
diff --git a/pkg/plugins/cat/cat.go b/pkg/plugins/cat/cat.go
index e6298ccf..df121ba6 100644
--- a/pkg/plugins/cat/cat.go
+++ b/pkg/plugins/cat/cat.go
@@ -51,8 +51,8 @@ const (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The cat plugin adds a cat image to an issue or PR in response to the `/meow` command.",
-		HelpProvider: helpProvider,
+		Description:        "The cat plugin adds a cat image to an issue or PR in response to the `/meow` command.",
+		ConfigHelpProvider: configHelp,
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -72,11 +72,9 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{
-			Config: map[string]string{
-				"": fmt.Sprintf("The cat plugin uses an api key for thecatapi.com stored in %s.", config.Cat.KeyPath),
-			},
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
+	return map[string]string{
+			"": fmt.Sprintf("The cat plugin uses an api key for thecatapi.com stored in %s.", config.Cat.KeyPath),
 		},
 		nil
 }
diff --git a/pkg/plugins/cherrypickunapproved/cherrypick-unapproved.go b/pkg/plugins/cherrypickunapproved/cherrypick-unapproved.go
index 2f670215..838508d5 100644
--- a/pkg/plugins/cherrypickunapproved/cherrypick-unapproved.go
+++ b/pkg/plugins/cherrypickunapproved/cherrypick-unapproved.go
@@ -29,7 +29,6 @@ import (
 	"github.com/sirupsen/logrus"
 
 	"github.com/jenkins-x/lighthouse/pkg/labels"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 )
 
@@ -42,25 +41,21 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "Label PRs against a release branch which do not have the `cherry-pick-approved` label with the `do-not-merge/cherry-pick-not-approved` label.",
-			HelpProvider:       helpProvider,
+			ConfigHelpProvider: configHelp,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// Only the 'Config' and Description' fields are necessary because this
-	// plugin does not react to any commands.
-	pluginHelp := &pluginhelp.PluginHelp{
-		Config: map[string]string{
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
+	return map[string]string{
 			"": fmt.Sprintf(
 				"The cherry-pick-unapproved plugin treats PRs against branch names satisfying the regular expression `%s` as cherry-pick PRs and adds the following comment:\n%s",
 				config.CherryPickUnapproved.BranchRegexp,
 				config.CherryPickUnapproved.Comment,
 			),
 		},
-	}
-	return pluginHelp, nil
+		nil
 }
 
 type scmProviderClient interface {
diff --git a/pkg/plugins/dog/dog.go b/pkg/plugins/dog/dog.go
index 25ecfe8e..a480c243 100644
--- a/pkg/plugins/dog/dog.go
+++ b/pkg/plugins/dog/dog.go
@@ -51,8 +51,7 @@ const (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The dog plugin adds a dog image to an issue or PR in response to the `/woof` command.",
-		HelpProvider: helpProvider,
+		Description: "The dog plugin adds a dog image to an issue or PR in response to the `/woof` command.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -71,11 +70,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	CreateComment(owner, repo string, number int, pr bool, comment string) error
 	QuoteAuthorForComment(string) string
diff --git a/pkg/plugins/help/help.go b/pkg/plugins/help/help.go
index c9001d3c..03459f52 100644
--- a/pkg/plugins/help/help.go
+++ b/pkg/plugins/help/help.go
@@ -58,8 +58,7 @@ by commenting with the ` + "`/remove-good-first-issue`" + ` command.
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The help plugin provides commands that add or remove the '" + labels.Help + "' and the '" + labels.GoodFirstIssue + "' labels from issues.",
-		HelpProvider: helpProvider,
+		Description: "The help plugin provides commands that add or remove the '" + labels.Help + "' and the '" + labels.GoodFirstIssue + "' labels from issues.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter: func(e scmprovider.GenericCommentEvent) bool {
@@ -80,11 +79,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	BotName() (string, error)
 	CreateComment(owner, repo string, number int, pr bool, comment string) error
diff --git a/pkg/plugins/hold/hold.go b/pkg/plugins/hold/hold.go
index ec4242b0..2f647b06 100644
--- a/pkg/plugins/hold/hold.go
+++ b/pkg/plugins/hold/hold.go
@@ -46,8 +46,7 @@ type hasLabelFunc func(label string, issueLabels []*scm.Label) bool
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The hold plugin allows anyone to add or remove the '" + labels.Hold + "' Label from a pull request in order to temporarily prevent the PR from merging without withholding approval.",
-		HelpProvider: helpProvider,
+		Description: "The hold plugin allows anyone to add or remove the '" + labels.Hold + "' Label from a pull request in order to temporarily prevent the PR from merging without withholding approval.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -66,11 +65,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	AddLabel(owner, repo string, number int, label string, pr bool) error
 	RemoveLabel(owner, repo string, number int, label string, pr bool) error
diff --git a/pkg/plugins/label/label.go b/pkg/plugins/label/label.go
index 62986a07..f34539e6 100644
--- a/pkg/plugins/label/label.go
+++ b/pkg/plugins/label/label.go
@@ -42,8 +42,8 @@ var (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The label plugin provides commands that add or remove certain types of labels. Labels of the following types can be manipulated: 'area/*', 'committee/*', 'kind/*', 'language/*', 'priority/*', 'sig/*', 'triage/*', and 'wg/*'. More labels can be configured to be used via the /label command.",
-		HelpProvider: helpProvider,
+		Description:        "The label plugin provides commands that add or remove certain types of labels. Labels of the following types can be manipulated: 'area/*', 'committee/*', 'kind/*', 'language/*', 'priority/*', 'sig/*', 'triage/*', and 'wg/*'. More labels can be configured to be used via the /label command.",
+		ConfigHelpProvider: configHelp,
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Help: []pluginhelp.Command{{
@@ -69,16 +69,14 @@ func configString(labels []string) string {
 	return fmt.Sprintf("The label plugin will work on %s and %s labels.", strings.Join(formattedLabels[:len(formattedLabels)-1], ", "), formattedLabels[len(formattedLabels)-1])
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	labels := []string{}
 	labels = append(labels, defaultLabels...)
 	labels = append(labels, config.Label.AdditionalLabels...)
-	pluginHelp := &pluginhelp.PluginHelp{
-		Config: map[string]string{
+	return map[string]string{
 			"": configString(labels),
 		},
-	}
-	return pluginHelp, nil
+		nil
 }
 
 func handleGenericComment(_ []string, pc plugins.Agent, e scmprovider.GenericCommentEvent) error {
diff --git a/pkg/plugins/lgtm/lgtm.go b/pkg/plugins/lgtm/lgtm.go
index cd038838..3fe7055c 100644
--- a/pkg/plugins/lgtm/lgtm.go
+++ b/pkg/plugins/lgtm/lgtm.go
@@ -59,8 +59,8 @@ type commentPruner interface {
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The lgtm plugin manages the application and removal of the 'lgtm' (Looks Good To Me) label which is typically used to gate merging.",
-		HelpProvider: helpProvider,
+		Description:        "The lgtm plugin manages the application and removal of the 'lgtm' (Looks Good To Me) label which is typically used to gate merging.",
+		ConfigHelpProvider: configHelp,
 		PullRequestHandler: func(pc plugins.Agent, pe scm.PullRequestHook) error {
 			return handlePullRequestEvent(pc, pe)
 		},
@@ -86,7 +86,7 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	configInfo := map[string]string{}
 	for _, orgRepo := range enabledRepos {
 		parts := strings.Split(orgRepo, "/")
@@ -119,8 +119,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 			configInfo[orgRepo] = strings.Join(configInfoStrings, "\n")
 		}
 	}
-	pluginHelp := &pluginhelp.PluginHelp{Config: configInfo}
-	return pluginHelp, nil
+	return configInfo, nil
 }
 
 // optionsForRepo gets the plugins.Lgtm struct that is applicable to the indicated repo.
diff --git a/pkg/plugins/lifecycle/lifecycle.go b/pkg/plugins/lifecycle/lifecycle.go
index 2c012282..93cec59b 100644
--- a/pkg/plugins/lifecycle/lifecycle.go
+++ b/pkg/plugins/lifecycle/lifecycle.go
@@ -37,8 +37,7 @@ const pluginName = "lifecycle"
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "Close, reopen, flag and/or unflag an issue or PR as frozen/stale/rotten",
-		HelpProvider: help,
+		Description: "Close, reopen, flag and/or unflag an issue or PR as frozen/stale/rotten",
 		Commands: []plugins.Command{{
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
 			GenericCommentHandler: lifecycleHandleGenericComment,
@@ -69,10 +68,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func help(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type lifecycleClient interface {
 	AddLabel(owner, repo string, number int, label string, pr bool) error
 	RemoveLabel(owner, repo string, number int, label string, pr bool) error
diff --git a/pkg/plugins/milestone/milestone.go b/pkg/plugins/milestone/milestone.go
index 1b1e4890..61643c32 100644
--- a/pkg/plugins/milestone/milestone.go
+++ b/pkg/plugins/milestone/milestone.go
@@ -53,8 +53,8 @@ type scmProviderClient interface {
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The milestone plugin allows members of a configurable GitHub team to set the milestone on an issue or pull request.",
-		HelpProvider: helpProvider,
+		Description:        "The milestone plugin allows members of a configurable GitHub team to set the milestone on an issue or pull request.",
+		ConfigHelpProvider: configHelp,
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -74,25 +74,19 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	msgForTeam := func(team plugins.Milestone) string {
 		return fmt.Sprintf(milestoneTeamMsg, team.MaintainersTeam, team.MaintainersID)
 	}
-
-	pluginHelp := &pluginhelp.PluginHelp{
-		Config: func(repos []string) map[string]string {
-			configMap := make(map[string]string)
-			for _, repo := range repos {
-				team, exists := config.RepoMilestone[repo]
-				if exists {
-					configMap[repo] = msgForTeam(team)
-				}
-			}
-			configMap[""] = msgForTeam(config.RepoMilestone[""])
-			return configMap
-		}(enabledRepos),
+	configMap := make(map[string]string)
+	for _, repo := range enabledRepos {
+		team, exists := config.RepoMilestone[repo]
+		if exists {
+			configMap[repo] = msgForTeam(team)
+		}
 	}
-	return pluginHelp, nil
+	configMap[""] = msgForTeam(config.RepoMilestone[""])
+	return configMap, nil
 }
 
 func handleGenericComment(match []string, pc plugins.Agent, e scmprovider.GenericCommentEvent) error {
diff --git a/pkg/plugins/milestonestatus/milestonestatus.go b/pkg/plugins/milestonestatus/milestonestatus.go
index 1df6847d..3bae14e7 100644
--- a/pkg/plugins/milestonestatus/milestonestatus.go
+++ b/pkg/plugins/milestonestatus/milestonestatus.go
@@ -46,8 +46,8 @@ var (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The milestonestatus plugin allows members of the milestone maintainers GitHub team to specify the 'status/*' label that should apply to a pull request.",
-		HelpProvider: helpProvider,
+		Description:        "The milestonestatus plugin allows members of the milestone maintainers GitHub team to specify the 'status/*' label that should apply to a pull request.",
+		ConfigHelpProvider: configHelp,
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -73,25 +73,19 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	msgForTeam := func(team plugins.Milestone) string {
 		return fmt.Sprintf(milestoneTeamMsg, team.MaintainersTeam, team.MaintainersID)
 	}
-
-	pluginHelp := &pluginhelp.PluginHelp{
-		Config: func() map[string]string {
-			configMap := make(map[string]string)
-			for _, repo := range enabledRepos {
-				team, exists := config.RepoMilestone[repo]
-				if exists {
-					configMap[repo] = msgForTeam(team)
-				}
-			}
-			configMap[""] = msgForTeam(config.RepoMilestone[""])
-			return configMap
-		}(),
+	configMap := make(map[string]string)
+	for _, repo := range enabledRepos {
+		team, exists := config.RepoMilestone[repo]
+		if exists {
+			configMap[repo] = msgForTeam(team)
+		}
 	}
-	return pluginHelp, nil
+	configMap[""] = msgForTeam(config.RepoMilestone[""])
+	return configMap, nil
 }
 
 func handleGenericComment(match []string, pc plugins.Agent, e scmprovider.GenericCommentEvent) error {
diff --git a/pkg/plugins/override/override.go b/pkg/plugins/override/override.go
index d5ed23e3..dd63642e 100644
--- a/pkg/plugins/override/override.go
+++ b/pkg/plugins/override/override.go
@@ -127,8 +127,7 @@ func (c client) presubmitForContext(org, repo, context string) *job.Presubmit {
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The override plugin allows repo admins to force a github status context to pass",
-		HelpProvider: helpProvider,
+		Description: "The override plugin allows repo admins to force a github status context to pass",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter: func(e scmprovider.GenericCommentEvent) bool {
@@ -149,10 +148,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 func handleGenericComment(_ []string, pc plugins.Agent, e scmprovider.GenericCommentEvent) error {
 	c := client{
 		spc:      pc.SCMProviderClient,
diff --git a/pkg/plugins/owners-label/owners-label.go b/pkg/plugins/owners-label/owners-label.go
index a5b742ed..faf7818a 100644
--- a/pkg/plugins/owners-label/owners-label.go
+++ b/pkg/plugins/owners-label/owners-label.go
@@ -22,7 +22,6 @@ import (
 	"github.com/jenkins-x/go-scm/scm"
 	"github.com/sirupsen/logrus"
 
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 	"k8s.io/apimachinery/pkg/util/sets"
 )
@@ -36,16 +35,11 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The owners-label plugin automatically adds labels to PRs based on the files they touch. Specifically, the 'labels' sections of OWNERS files are used to determine which labels apply to the changes.",
-			HelpProvider:       helpProvider,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type ownersClient interface {
 	FindLabelsForFile(path string) sets.String
 }
diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go
index 38e2af45..df735a9e 100644
--- a/pkg/plugins/plugins.go
+++ b/pkg/plugins/plugins.go
@@ -77,7 +77,7 @@ func (cmd Command) InvokeHandler(ce *scmprovider.GenericCommentEvent, handler fu
 // Plugin defines a plugin and its handlers
 type Plugin struct {
 	Description        string
-	HelpProvider       HelpProvider
+	ConfigHelpProvider ConfigHelpProvider
 	IssueHandler       IssueHandler
 	PullRequestHandler PullRequestHandler
 	PushEventHandler   PushEventHandler
@@ -105,6 +105,9 @@ func RegisterPlugin(name string, plugin Plugin) {
 // plugins. It takes into account the plugins configuration and enabled repositories.
 type HelpProvider func(config *Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error)
 
+// ConfigHelpProvider defines the function type that constructs help about a plugin configuration.
+type ConfigHelpProvider func(config *Configuration, enabledRepos []string) (map[string]string, error)
+
 // IssueHandler defines the function contract for a scm.Issue handler.
 type IssueHandler func(Agent, scm.Issue) error
 
@@ -133,19 +136,24 @@ type GenericCommentHandler func([]string, Agent, scmprovider.GenericCommentEvent
 func HelpProviders() map[string]HelpProvider {
 	pluginHelp := make(map[string]HelpProvider)
 	for k, v := range plugins {
-		if v.HelpProvider != nil {
-			pluginHelp[k] = func(config *Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-				h, err := v.HelpProvider(config, enabledRepos)
-				if h != nil {
-					h.Description = v.Description
-				}
-				for _, c := range v.Commands {
-					for _, hh := range c.Help {
-						h.AddCommand(hh)
-					}
+		pluginHelp[k] = func(config *Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+			var err error
+			h := &pluginhelp.PluginHelp{
+				Description: v.Description,
+			}
+			if v.ConfigHelpProvider != nil {
+				h.Config, err = v.ConfigHelpProvider(config, enabledRepos)
+			}
+			if h != nil {
+				h.Description = v.Description
+			}
+			for _, c := range v.Commands {
+				for _, cc := range c.Help {
+					h.AddCommand(cc)
 				}
-				return h, err
 			}
+			h.Events = EventsForPlugin(v)
+			return h, err
 		}
 	}
 	return pluginHelp
@@ -362,22 +370,25 @@ func (pa *ConfigAgent) GetPlugins(owner, repo string) map[string]Plugin {
 }
 
 // EventsForPlugin returns the registered events for the passed plugin.
-func EventsForPlugin(name string) []string {
+func EventsForPlugin(plugin Plugin) []string {
 	var events []string
-	if p, ok := plugins[name]; ok && p.IssueHandler != nil {
+	if plugin.IssueHandler != nil {
 		events = append(events, "issue")
 	}
-	if p, ok := plugins[name]; ok && p.PullRequestHandler != nil {
+	if plugin.PullRequestHandler != nil {
 		events = append(events, "pull_request")
 	}
-	if p, ok := plugins[name]; ok && p.PushEventHandler != nil {
+	if plugin.PushEventHandler != nil {
 		events = append(events, "push")
 	}
-	if p, ok := plugins[name]; ok && p.ReviewEventHandler != nil {
+	if plugin.ReviewEventHandler != nil {
 		events = append(events, "pull_request_review")
 	}
-	if p, ok := plugins[name]; ok && p.StatusEventHandler != nil {
+	if plugin.StatusEventHandler != nil {
 		events = append(events, "status")
 	}
+	if plugin.Commands != nil && len(plugin.Commands) > 0 {
+		events = append(events, "GenericCommentEvent (any event for user text)")
+	}
 	return events
 }
diff --git a/pkg/plugins/pony/pony.go b/pkg/plugins/pony/pony.go
index 6d46f2db..32a49530 100644
--- a/pkg/plugins/pony/pony.go
+++ b/pkg/plugins/pony/pony.go
@@ -57,8 +57,7 @@ var (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The pony plugin adds a pony image to an issue or PR in response to the `/pony` command.",
-		HelpProvider: helpProvider,
+		Description: "The pony plugin adds a pony image to an issue or PR in response to the `/pony` command.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -77,11 +76,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 var client = http.Client{}
 
 type scmProviderClient interface {
diff --git a/pkg/plugins/shrug/shrug.go b/pkg/plugins/shrug/shrug.go
index c28fc6ca..99da1a20 100644
--- a/pkg/plugins/shrug/shrug.go
+++ b/pkg/plugins/shrug/shrug.go
@@ -50,8 +50,7 @@ type event struct {
 
 var (
 	plugin = plugins.Plugin{
-		Description:  labels.Shrug,
-		HelpProvider: helpProvider,
+		Description: labels.Shrug,
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
@@ -70,11 +69,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	AddLabel(owner, repo string, number int, label string, pr bool) error
 	CreateComment(owner, repo string, number int, pr bool, comment string) error
diff --git a/pkg/plugins/sigmention/sigmention.go b/pkg/plugins/sigmention/sigmention.go
index 22b145d2..066d2b19 100644
--- a/pkg/plugins/sigmention/sigmention.go
+++ b/pkg/plugins/sigmention/sigmention.go
@@ -26,7 +26,6 @@ import (
 
 	"github.com/jenkins-x/go-scm/scm"
 	"github.com/jenkins-x/lighthouse/pkg/labels"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 	"github.com/jenkins-x/lighthouse/pkg/scmprovider"
 	"github.com/sirupsen/logrus"
@@ -72,8 +71,8 @@ func init() {
 	plugins.RegisterPlugin(
 		pluginName,
 		plugins.Plugin{
-			Description:  description,
-			HelpProvider: helpProvider,
+			Description:        description,
+			ConfigHelpProvider: configHelp,
 			Commands: []plugins.Command{
 				sigmentionCommand,
 			},
@@ -81,11 +80,9 @@ func init() {
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{
-			Config: map[string]string{
-				"": fmt.Sprintf("Labels added by the plugin are triggered by mentions of GitHub teams matching the following regexp:\n%s", config.SigMention.Regexp),
-			},
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
+	return map[string]string{
+			"": fmt.Sprintf("Labels added by the plugin are triggered by mentions of GitHub teams matching the following regexp:\n%s", config.SigMention.Regexp),
 		},
 		nil
 }
diff --git a/pkg/plugins/size/size.go b/pkg/plugins/size/size.go
index ab69d453..acdb7d46 100644
--- a/pkg/plugins/size/size.go
+++ b/pkg/plugins/size/size.go
@@ -28,7 +28,6 @@ import (
 
 	"github.com/jenkins-x/lighthouse/pkg/genfiles"
 	"github.com/jenkins-x/lighthouse/pkg/gitattributes"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 )
 
@@ -49,17 +48,16 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The size plugin manages the 'size/*' labels, maintaining the appropriate label on each pull request as it is updated. Generated files identified by the config file '.generated_files' at the repo root are ignored. Labels are applied based on the total number of lines of changes (additions and deletions).",
-			HelpProvider:       helpProvider,
+			ConfigHelpProvider: configHelp,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	sizes := sizesOrDefault(config.Size)
-	return &pluginhelp.PluginHelp{
-			Config: map[string]string{
-				"": fmt.Sprintf(`The plugin has the following thresholds:<ul>
+	return map[string]string{
+			"": fmt.Sprintf(`The plugin has the following thresholds:<ul>
 <li>size/XS:  0-%d</li>
 <li>size/S:   %d-%d</li>
 <li>size/M:   %d-%d</li>
@@ -67,7 +65,6 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 <li>size/XL:  %d-%d</li>
 <li>size/XXL: %d+</li>
 </ul>`, sizes.S-1, sizes.S, sizes.M-1, sizes.M, sizes.L-1, sizes.L, sizes.Xl-1, sizes.Xl, sizes.Xxl-1, sizes.Xxl),
-			},
 		},
 		nil
 }
diff --git a/pkg/plugins/skip/skip.go b/pkg/plugins/skip/skip.go
index 3f486a2e..35c6ba8f 100644
--- a/pkg/plugins/skip/skip.go
+++ b/pkg/plugins/skip/skip.go
@@ -48,8 +48,7 @@ type scmProviderClient interface {
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The skip plugin allows users to clean up GitHub stale commit statuses for non-blocking jobs on a PR.",
-		HelpProvider: helpProvider,
+		Description: "The skip plugin allows users to clean up GitHub stale commit statuses for non-blocking jobs on a PR.",
 		Commands: []plugins.Command{{
 			GenericCommentHandler: handleGenericComment,
 			Filter: func(e scmprovider.GenericCommentEvent) bool {
@@ -71,10 +70,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 func handleGenericComment(_ []string, pc plugins.Agent, e scmprovider.GenericCommentEvent) error {
 	honorOkToTest := trigger.HonorOkToTest(pc.PluginConfig.TriggerFor(e.Repo.Namespace, e.Repo.Name))
 	return handle(pc.SCMProviderClient, pc.Logger, &e, pc.Config.GetPresubmits(e.Repo), honorOkToTest)
diff --git a/pkg/plugins/stage/stage.go b/pkg/plugins/stage/stage.go
index b25e5329..a0250a20 100644
--- a/pkg/plugins/stage/stage.go
+++ b/pkg/plugins/stage/stage.go
@@ -41,8 +41,7 @@ const pluginName = "stage"
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "Label the stage of an issue as alpha/beta/stable",
-		HelpProvider: help,
+		Description: "Label the stage of an issue as alpha/beta/stable",
 		Commands: []plugins.Command{{
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
 			Regex:                 stageRe,
@@ -62,11 +61,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func help(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type stageClient interface {
 	AddLabel(owner, repo string, number int, label string, pr bool) error
 	RemoveLabel(owner, repo string, number int, label string, pr bool) error
diff --git a/pkg/plugins/trigger/trigger.go b/pkg/plugins/trigger/trigger.go
index 077a5a6a..7df15c2f 100644
--- a/pkg/plugins/trigger/trigger.go
+++ b/pkg/plugins/trigger/trigger.go
@@ -43,7 +43,7 @@ var (
 		Description: `The trigger plugin starts tests in reaction to commands and pull request events. It is responsible for ensuring that test jobs are only run on trusted PRs. A PR is considered trusted if the author is a member of the 'trusted organization' for the repository or if such a member has left an '/ok-to-test' command on the PR.
 <br>Trigger starts jobs automatically when a new trusted PR is created or when an untrusted PR becomes trusted, but it can also be used to start jobs manually via the '/test' command.
 <br>The '/retest' command can be used to rerun jobs that have reported failure.`,
-		HelpProvider:       helpProvider,
+		ConfigHelpProvider: configHelp,
 		PullRequestHandler: handlePullRequest,
 		PushEventHandler:   handlePush,
 		Commands: []plugins.Command{{
@@ -78,7 +78,7 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	configInfo := map[string]string{}
 	for _, orgRepo := range enabledRepos {
 		parts := strings.Split(orgRepo, "/")
@@ -97,7 +97,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 		}
 		configInfo[orgRepo] = fmt.Sprintf("The trusted GitHub organization for this repository is %q.", org)
 	}
-	return &pluginhelp.PluginHelp{Config: configInfo}, nil
+	return configInfo, nil
 }
 
 type scmProviderClient interface {
diff --git a/pkg/plugins/updateconfig/updateconfig.go b/pkg/plugins/updateconfig/updateconfig.go
index 629bd076..7885c233 100644
--- a/pkg/plugins/updateconfig/updateconfig.go
+++ b/pkg/plugins/updateconfig/updateconfig.go
@@ -28,7 +28,6 @@ import (
 
 	"github.com/jenkins-x/go-scm/scm"
 	config2 "github.com/jenkins-x/lighthouse/pkg/config"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 	"github.com/jenkins-x/lighthouse/pkg/util"
 	zglob "github.com/mattn/go-zglob"
@@ -54,13 +53,13 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The config-updater plugin automatically redeploys configuration and plugin configuration files when they change. The plugin watches for pull request merges that modify either of the config files and updates the cluster's configmap resources in response.",
-			HelpProvider:       helpProvider,
+			ConfigHelpProvider: configHelp,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	var configInfo map[string]string
 	if len(enabledRepos) == 1 {
 		msg := fmt.Sprintf(
@@ -72,7 +71,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 		)
 		configInfo = map[string]string{"": msg}
 	}
-	return &pluginhelp.PluginHelp{Config: configInfo}, nil
+	return configInfo, nil
 }
 
 type scmProviderClient interface {
diff --git a/pkg/plugins/welcome/welcome.go b/pkg/plugins/welcome/welcome.go
index ae785c5e..816e97ba 100644
--- a/pkg/plugins/welcome/welcome.go
+++ b/pkg/plugins/welcome/welcome.go
@@ -26,7 +26,6 @@ import (
 	"github.com/jenkins-x/go-scm/scm"
 	"github.com/sirupsen/logrus"
 
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 	"k8s.io/apimachinery/pkg/util/sets"
 )
@@ -49,13 +48,13 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The welcome plugin posts a welcoming message when it detects a user's first contribution to a repo.",
-			HelpProvider:       helpProvider,
+			ConfigHelpProvider: configHelp,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
+func configHelp(config *plugins.Configuration, enabledRepos []string) (map[string]string, error) {
 	welcomeConfig := map[string]string{}
 	for _, repo := range enabledRepos {
 		parts := strings.Split(repo, "/")
@@ -72,7 +71,7 @@ func helpProvider(config *plugins.Configuration, enabledRepos []string) (*plugin
 	}
 
 	// The {WhoCanUse, Usage, Examples} fields are omitted because this plugin is not triggered with commands.
-	return &pluginhelp.PluginHelp{Config: welcomeConfig}, nil
+	return welcomeConfig, nil
 }
 
 type scmProviderClient interface {
diff --git a/pkg/plugins/wip/wip-label.go b/pkg/plugins/wip/wip-label.go
index 1f253010..c9ec7e20 100644
--- a/pkg/plugins/wip/wip-label.go
+++ b/pkg/plugins/wip/wip-label.go
@@ -29,7 +29,6 @@ import (
 	"github.com/sirupsen/logrus"
 
 	"github.com/jenkins-x/lighthouse/pkg/labels"
-	"github.com/jenkins-x/lighthouse/pkg/pluginhelp"
 	"github.com/jenkins-x/lighthouse/pkg/plugins"
 )
 
@@ -56,17 +55,11 @@ func init() {
 		pluginName,
 		plugins.Plugin{
 			Description:        "The wip (Work In Progress) plugin applies the '" + labels.WorkInProgress + "' Label to pull requests whose title starts with 'WIP' or are in the 'draft' stage, and removes it from pull requests when they remove the title prefix or become ready for review. The '" + labels.WorkInProgress + "' Label is typically used to block a pull request from merging while it is still in progress.",
-			HelpProvider:       helpProvider,
 			PullRequestHandler: handlePullRequest,
 		},
 	)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// Only the Description field is specified because this plugin is not triggered with commands and is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 // Strict subset of gitprovider.Client methods.
 type scmProviderClient interface {
 	GetIssueLabels(org, repo string, number int, pr bool) ([]*scm.Label, error)
diff --git a/pkg/plugins/yuks/yuks.go b/pkg/plugins/yuks/yuks.go
index 3e4daa55..c9e0c793 100644
--- a/pkg/plugins/yuks/yuks.go
+++ b/pkg/plugins/yuks/yuks.go
@@ -44,8 +44,7 @@ const (
 
 var (
 	plugin = plugins.Plugin{
-		Description:  "The yuks plugin comments with jokes in response to the `/joke` command.",
-		HelpProvider: helpProvider,
+		Description: "The yuks plugin comments with jokes in response to the `/joke` command.",
 		Commands: []plugins.Command{{
 			Filter:                func(e scmprovider.GenericCommentEvent) bool { return e.Action == scm.ActionCreate },
 			Regex:                 match,
@@ -65,11 +64,6 @@ func init() {
 	plugins.RegisterPlugin(pluginName, plugin)
 }
 
-func helpProvider(config *plugins.Configuration, enabledRepos []string) (*pluginhelp.PluginHelp, error) {
-	// The Config field is omitted because this plugin is not configurable.
-	return &pluginhelp.PluginHelp{}, nil
-}
-
 type scmProviderClient interface {
 	CreateComment(owner, repo string, number int, pr bool, comment string) error
 	QuoteAuthorForComment(string) string


Test patch:
diff --git a/pkg/plugins/approve/approve_test.go b/pkg/plugins/approve/approve_test.go
index 9fe85cc5..63bdabdd 100644
--- a/pkg/plugins/approve/approve_test.go
+++ b/pkg/plugins/approve/approve_test.go
@@ -1926,7 +1926,7 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			_, err := helpProvider(c.config, c.enabledRepos)
+			_, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
diff --git a/pkg/plugins/blockade/blockade_test.go b/pkg/plugins/blockade/blockade_test.go
index d99b51e3..73bd56ba 100644
--- a/pkg/plugins/blockade/blockade_test.go
+++ b/pkg/plugins/blockade/blockade_test.go
@@ -396,7 +396,7 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			_, err := helpProvider(c.config, c.enabledRepos)
+			_, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
diff --git a/pkg/plugins/label/label_test.go b/pkg/plugins/label/label_test.go
index 4bd19bfd..44e5c582 100644
--- a/pkg/plugins/label/label_test.go
+++ b/pkg/plugins/label/label_test.go
@@ -559,12 +559,12 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			pluginHelp, err := helpProvider(c.config, c.enabledRepos)
+			pluginHelp, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
 			for _, msg := range c.configInfoIncludes {
-				if !strings.Contains(pluginHelp.Config[""], msg) {
+				if !strings.Contains(pluginHelp[""], msg) {
 					t.Fatalf("helpProvider.Config error mismatch: didn't get %v, but wanted it", msg)
 				}
 			}
diff --git a/pkg/plugins/lgtm/lgtm_test.go b/pkg/plugins/lgtm/lgtm_test.go
index 4881711e..eebb601b 100644
--- a/pkg/plugins/lgtm/lgtm_test.go
+++ b/pkg/plugins/lgtm/lgtm_test.go
@@ -1229,17 +1229,17 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			pluginHelp, err := helpProvider(c.config, c.enabledRepos)
+			pluginHelp, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
 			for _, msg := range c.configInfoExcludes {
-				if strings.Contains(pluginHelp.Config["org2/repo"], msg) {
+				if strings.Contains(pluginHelp["org2/repo"], msg) {
 					t.Fatalf("helpProvider.Config error mismatch: got %v, but didn't want it", msg)
 				}
 			}
 			for _, msg := range c.configInfoIncludes {
-				if !strings.Contains(pluginHelp.Config["org2/repo"], msg) {
+				if !strings.Contains(pluginHelp["org2/repo"], msg) {
 					t.Fatalf("helpProvider.Config error mismatch: didn't get %v, but wanted it", msg)
 				}
 			}
diff --git a/pkg/plugins/size/size_test.go b/pkg/plugins/size/size_test.go
index 389e2184..83a29531 100644
--- a/pkg/plugins/size/size_test.go
+++ b/pkg/plugins/size/size_test.go
@@ -670,7 +670,7 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			_, err := helpProvider(c.config, c.enabledRepos)
+			_, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
diff --git a/pkg/plugins/trigger/trigger_test.go b/pkg/plugins/trigger/trigger_test.go
index 64728ae1..9fb96844 100644
--- a/pkg/plugins/trigger/trigger_test.go
+++ b/pkg/plugins/trigger/trigger_test.go
@@ -71,7 +71,7 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			_, err := helpProvider(c.config, c.enabledRepos)
+			_, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}
diff --git a/pkg/plugins/welcome/welcome_test.go b/pkg/plugins/welcome/welcome_test.go
index 6a95993a..78562f5d 100644
--- a/pkg/plugins/welcome/welcome_test.go
+++ b/pkg/plugins/welcome/welcome_test.go
@@ -365,7 +365,7 @@ func TestHelpProvider(t *testing.T) {
 	}
 	for _, c := range cases {
 		t.Run(c.name, func(t *testing.T) {
-			_, err := helpProvider(c.config, c.enabledRepos)
+			_, err := configHelp(c.config, c.enabledRepos)
 			if err != nil && !c.err {
 				t.Fatalf("helpProvider error: %v", err)
 			}