Repository: jenkins-x/lighthouse
Pull request #925 (2020-08-16 07:55:21)

chore: Remove slack plugin config (dead code)
This PR removes the slack plugin config (dead code)

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 **ccojocar**
You can assign the PR to them by writing `/assign @ccojocar` 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":["ccojocar"]} -->

Patch:
diff --git a/charts/lighthouse/templates/plugins-cm.yaml b/charts/lighthouse/templates/plugins-cm.yaml
index c9d9c584..f079324b 100644
--- a/charts/lighthouse/templates/plugins-cm.yaml
+++ b/charts/lighthouse/templates/plugins-cm.yaml
@@ -74,7 +74,6 @@ data:
       s: 0
       xl: 0
       xxl: 0
-    slack: {}
     triggers: []
     # Example triggers configuration:
     # - repos:
diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md
index 073426da..f4dc4584 100644
--- a/docs/PLUGINS.md
+++ b/docs/PLUGINS.md
@@ -2,7 +2,7 @@
 
 ## Lighthouse plugins list
 
-| plugin name           | configuration stanza    | docs |
+| plugin name           | configuration stanza      | docs |
 | --------------------- | ------------------------- | ---- |
 | approve               | `approve`                 | TODO |
 | assign                |                           | TODO |
@@ -21,15 +21,15 @@
 | override              |                           | TODO |
 | owners-label          |                           | TODO |
 | pony                  |                           | TODO |
-| shrug                 |                           | TODO |
+| shrug                 |                           | [docs](./plugins/shrug.md) |
 | sigmention            | `sigmention`              | TODO |
-| size                  | `size`                    | TODO |
+| size                  | `size`                    | [docs](./plugins/size.md) |
 | skip                  |                           | TODO |
 | stage                 |                           | TODO |
 | trigger               | `triggers`                | TODO |
 | updateconfig          | `config_updater`          | TODO |
-| welcome               | `welcome`                 | TODO |
-| wip                   |                           | TODO |
+| welcome               | `welcome`                 | [docs](./plugins/welcome.md) |
+| wip                   |                           | [docs](./plugins/wip.md)  |
 | yuks                  |                           | [docs](./plugins/yuks.md) |
 
 ## Plugins configuration file (plugins.yaml)
@@ -58,7 +58,6 @@ require_matching_label: {}
 requiresig: {}
 sigmention: {}
 size: {}
-slack: {}
 triggers: []
 welcome: []
 
diff --git a/docs/plugins/shrug.md b/docs/plugins/shrug.md
new file mode 100644
index 00000000..cd6a4fee
--- /dev/null
+++ b/docs/plugins/shrug.md
@@ -0,0 +1,32 @@
+# shrug
+
+`shrug` plugin documentation:
+- [Description](#description)
+- [Commands](#commands)
+- [Configuration](#configuration)
+- [Compatibility matrix](#compatibility-matrix)
+
+## Description
+
+The shrug plugin applies the `¯\_(ツ)_/¯` label to pull requests.
+
+## Commands
+
+### /shrug or /lh-shrug
+
+The `/shrug` or `/lh-shrug` commands add the `¯\_(ツ)_/¯` label to a pull request.
+
+### /unshrug or /lh-unshrug
+
+The `/unshrug` or `/lh-unshrug` commands remove the `¯\_(ツ)_/¯` label to a pull request.
+
+## Configuration
+
+This plugin has no configuration option.
+
+## Compatibility matrix
+
+|               | GitHub | GitHub Enterprise | BitBucket Server | GitLab |
+| ------------- | ------ | ----------------- | ---------------- | ------ |
+| Pull requests | Yes    | Yes               | Yes              | Yes    |
+| Commits       | No     | No                | No               | No     |
diff --git a/docs/plugins/size.md b/docs/plugins/size.md
new file mode 100644
index 00000000..dcfca6b0
--- /dev/null
+++ b/docs/plugins/size.md
@@ -0,0 +1,68 @@
+# yuks
+
+`size` plugin documentation:
+- [Description](#description)
+- [Commands](#commands)
+- [Configuration](#configuration)
+- [Compatibility matrix](#compatibility-matrix)
+
+## Description
+
+The size plugin manages the `size/*` labels of pull requests, maintaining the appropriate label on each pull request as it is updated.
+
+Generated files identified by the config file `.generated_files` at the repository root are ignored.
+
+Labels are applied based on the total number of lines of changes (additions and deletions).
+
+Thresholds for `XL`, `S`, `M`, `L`, `XL` and `XXL` sizes can be [configured](#confiiguration), if not configured [default size thresholds](#default-size-thresholds) are used.
+
+## Commands
+
+This plugin has no commands.
+
+## Configuration
+
+### Configuration stanza
+
+| stanza    | type                       |
+| --------- | -------------------------- |
+| `size`    | [Size](#size-type)         |
+
+### Size type
+
+| field   | type     | note                                                 | default value |
+| ------- | -------- | ---------------------------------------------------- | ------------- |
+| `s`     | int      | number of lines of changes to apply the `s` size     | 10            |
+| `m`     | int      | number of lines of changes to apply the `m` size     | 30            |
+| `l`     | int      | number of lines of changes to apply the `l` size     | 100           |
+| `xl`    | int      | number of lines of changes to apply the `xl` size    | 500           |
+| `xxl`   | int      | number of lines of changes to apply the `xxl` size   | 1000          |
+
+### Default size thresholds
+
+| size         | threshold |
+| ------------ | --------- |
+| `size/XS`    | 0 - 9     |
+| `size/S`     | 10 - 29   |
+| `size/M`     | 30 - 99   |
+| `size/L`     | 100 - 499 |
+| `size/XL`    | 500 - 999 |
+| `size/XXL`   | 1000+     |
+
+### Example
+
+```yaml
+size:
+  s: 20
+  m: 50
+  l: 150
+  xl: 800
+  xxl: 1500
+```
+
+## Compatibility matrix
+
+|               | GitHub | GitHub Enterprise | BitBucket Server | GitLab |
+| ------------- | ------ | ----------------- | ---------------- | ------ |
+| Pull requests | Yes    | Yes               | Yes              | Yes    |
+| Commits       | No     | No                | No               | No     |
diff --git a/docs/plugins/welcome.md b/docs/plugins/welcome.md
new file mode 100644
index 00000000..332d541d
--- /dev/null
+++ b/docs/plugins/welcome.md
@@ -0,0 +1,70 @@
+# welcome
+
+`welcome` plugin documentation:
+- [Description](#description)
+- [Commands](#commands)
+- [Configuration](#configuration)
+- [Compatibility matrix](#compatibility-matrix)
+
+## Description
+
+The welcome plugin posts a welcoming message in the pull request comments when it detects a user's first contribution to a repo.
+
+The welcoming message can be configured per SCM repository.
+
+Looking up the welcoming message for a given repository is done in the following order:
+- `org/repo` first
+- `org` only if there was no `org/repo` match
+- [default message template](#default-message-template) is used if there was no match
+
+## Commands
+
+This plugin has no commands.
+
+## Configuration
+
+### Configuration stanza
+
+| stanza    | type                       |
+| --------- | -------------------------- |
+| `welcome` | [][Welcome](#welcome-type) |
+
+### Welcome type
+
+| field              | type     | note                                                                                                                                    |
+| ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| `repos`            | []string | can be in the form `org/repo` or just `org`                                                                                             |
+| `message_template` | string   | go template used to create the welcoming message, see [Infos provided to the message template](#infos-provided-to-the-message-template) |
+
+### Infos provided to the message template
+
+| key         | type   |
+| ----------- | ------ |
+| Org         | string |
+| Repo        | string |
+| AuthorLogin | string |
+| AuthorName  | string |
+
+### Default message template
+
+"Welcome @{{.AuthorLogin}}! It looks like this is your first PR to {{.Org}}/{{.Repo}} 🎉"
+
+### Example
+
+```yaml
+welcome:
+  - repos:
+      - org1/repo1
+      - org1/repo2
+    message_template: Welcome @{{.AuthorLogin}} !
+  - repos:
+      - org2
+    message_template: Nice to meet you @{{.AuthorLogin}} !
+```
+
+## Compatibility matrix
+
+|               | GitHub | GitHub Enterprise | BitBucket Server | GitLab |
+| ------------- | ------ | ----------------- | ---------------- | ------ |
+| Pull requests | Yes    | Yes               | Yes              | Yes    |
+| Commits       | No     | No                | No               | No     |
diff --git a/docs/plugins/wip.md b/docs/plugins/wip.md
new file mode 100644
index 00000000..817e9940
--- /dev/null
+++ b/docs/plugins/wip.md
@@ -0,0 +1,31 @@
+# wip
+
+`wip` plugin documentation:
+- [Description](#description)
+- [Commands](#commands)
+- [Configuration](#configuration)
+- [Compatibility matrix](#compatibility-matrix)
+
+## Description
+
+The wip (work in progress) plugin applies the `do-not-merge/work-in-progress` label to pull requests.
+
+Pull requests whose title starts with 'WIP' or are in the 'Draft' stage also get the `do-not-merge/work-in-progress` label applied.
+The label is removed when the 'WIP' title prefix is removed or the pull request becomes ready for review.
+ 
+The `do-not-merge/work-in-progress` label is typically used to block a pull request from merging while it is still in progress.
+
+## Commands
+
+This plugin has no commands.
+
+## Configuration
+
+This plugin has no configuration option.
+
+## Compatibility matrix
+
+|               | GitHub | GitHub Enterprise | BitBucket Server | GitLab |
+| ------------- | ------ | ----------------- | ---------------- | ------ |
+| Pull requests | Yes    | Yes               | Yes              | Yes    |
+| Commits       | No     | No                | No               | No     |
diff --git a/docs/plugins/yuks.md b/docs/plugins/yuks.md
index f97db1a5..9dea879b 100644
--- a/docs/plugins/yuks.md
+++ b/docs/plugins/yuks.md
@@ -12,9 +12,9 @@ The yuks plugin comments with jokes.
 
 ## Commands
 
-### /joke
+### /joke or /lh-joke
 
-Posts comments with jokes in response to the `/joke` command.
+Posts comments with jokes in response to the `/joke` or `/lh-joke` commands.
 
 ## Configuration
 
diff --git a/pkg/plugins/config.go b/pkg/plugins/config.go
index bdc4b5de..07f5a72a 100644
--- a/pkg/plugins/config.go
+++ b/pkg/plugins/config.go
@@ -64,7 +64,6 @@ type Configuration struct {
 	RepoMilestone              map[string]Milestone   `json:"repo_milestone,omitempty"`
 	RequireMatchingLabel       []RequireMatchingLabel `json:"require_matching_label,omitempty"`
 	RequireSIG                 RequireSIG             `json:"requiresig,omitempty"`
-	Slack                      Slack                  `json:"slack,omitempty"`
 	SigMention                 SigMention             `json:"sigmention,omitempty"`
 	Size                       Size                   `json:"size,omitempty"`
 	Triggers                   []Trigger              `json:"triggers,omitempty"`
@@ -351,12 +350,6 @@ type Milestone struct {
 	MaintainersFriendlyName string `json:"maintainers_friendly_name,omitempty"`
 }
 
-// Slack contains the configuration for the slack plugin.
-type Slack struct {
-	MentionChannels []string       `json:"mentionchannels,omitempty"`
-	MergeWarnings   []MergeWarning `json:"mergewarnings,omitempty"`
-}
-
 // ConfigMapSpec contains configuration options for the configMap being updated
 // by the config-updater plugin.
 type ConfigMapSpec struct {
@@ -403,24 +396,6 @@ type ConfigUpdater struct {
 	GZIP bool `json:"gzip"`
 }
 
-// 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 includes.
-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 includes.
-	Includes []string `json:"includes,omitempty"`
-	// Deprecated in favor of Includes
-	Whitelist []string `json:"whitelist,omitempty"`
-	// A slack event is published if the user is not in the branch includes
-	BranchIncludes map[string][]string `json:"branch_includes,omitempty"`
-	// Deprecated in favor of BranchIncludes
-	BranchWhitelist map[string][]string `json:"branch_whitelist,omitempty"`
-}
-
 // Welcome is config for the welcome plugin.
 type Welcome struct {
 	// Repos is either of the form org/repos or just org.


Test patch:
diff --git a/pkg/repoconfig/merge/test_data/simple/expected-plugins.yaml b/pkg/repoconfig/merge/test_data/simple/expected-plugins.yaml
index 545046fd..404eab00 100644
--- a/pkg/repoconfig/merge/test_data/simple/expected-plugins.yaml
+++ b/pkg/repoconfig/merge/test_data/simple/expected-plugins.yaml
@@ -55,7 +55,6 @@ size:
   s: 0
   xl: 0
   xxl: 0
-slack: {}
 triggers:
 - repos:
   - someorg/somerepo
diff --git a/pkg/repoconfig/merge/test_data/simple/source-plugins.yaml b/pkg/repoconfig/merge/test_data/simple/source-plugins.yaml
index 7bcb97f3..a83717fb 100644
--- a/pkg/repoconfig/merge/test_data/simple/source-plugins.yaml
+++ b/pkg/repoconfig/merge/test_data/simple/source-plugins.yaml
@@ -40,7 +40,6 @@ size:
   s: 0
   xl: 0
   xxl: 0
-slack: {}
 triggers:
 - repos:
   - someorg/somerepo
diff --git a/pkg/webhook/test_data/test_plugins.yaml b/pkg/webhook/test_data/test_plugins.yaml
index 3fd99b16..99743c35 100644
--- a/pkg/webhook/test_data/test_plugins.yaml
+++ b/pkg/webhook/test_data/test_plugins.yaml
@@ -578,7 +578,6 @@ plugins:
   - override
 requiresig: {}
 sigmention: {}
-slack: {}
 triggers:
 - repos:
   - jenkins-x/dummy
diff --git a/test/e2e/test_data/example-plugins.tmpl.yml b/test/e2e/test_data/example-plugins.tmpl.yml
index 3de5de74..b350f564 100644
--- a/test/e2e/test_data/example-plugins.tmpl.yml
+++ b/test/e2e/test_data/example-plugins.tmpl.yml
@@ -38,7 +38,6 @@ size:
   s: 0
   xl: 0
   xxl: 0
-slack: {}
 triggers:
 - repos:
   - {{ .Owner }}/{{ .Repo }}