Skip to content

slack/bot: add moderate words bot#41

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
cpanato:GH-27
Feb 22, 2021
Merged

slack/bot: add moderate words bot#41
k8s-ci-robot merged 1 commit intokubernetes-sigs:masterfrom
cpanato:GH-27

Conversation

@cpanato
Copy link
Copy Markdown
Member

@cpanato cpanato commented Feb 8, 2021

Add slack bot service to moderate words in a public channel

Fixes: #27

Screen Shot 2021-02-08 at 14 44 45

Right now it is posting ephemeral messages when a word matches the filter config.
We can extend to delete/other actions

/assign @nikhita @jeefy

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 8, 2021
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 8, 2021
@cpanato
Copy link
Copy Markdown
Member Author

cpanato commented Feb 8, 2021

also works in threads
Screen Shot 2021-02-08 at 14 54 58

@nikhita
Copy link
Copy Markdown
Member

nikhita commented Feb 8, 2021

/cc @BenTheElder

@jeefy
Copy link
Copy Markdown
Member

jeefy commented Feb 8, 2021

/approve

This is awesome work, thank you so much!

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, jeefy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2021
Copy link
Copy Markdown
Member

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice stuff!

spec:
containers:
- name: slack-moderator-words
image: gcr.io/kubernetes-tools/slack-moderator-words:latest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version this or add imagePullPolicy: always?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot always is implicitly/magically the default for containers with image :latest, this is probably my least favorite thing in the API :|

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think after we merge we will need to update this right? because it might trigger a job to build the images or not?

Comment thread slack-moderate-words/README.md Outdated
Comment thread slack-moderate-words/events.go
Comment thread slack-moderate-words/model/slack.go
Comment thread slack-moderate-words/model/filter.go Outdated

type FilterConfig []struct {
Triggers []string `yaml:"triggers"`
Action string `yaml:"action"`
Copy link
Copy Markdown
Member

@nikhita nikhita Feb 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not in this PR) it'd be nice to validate the filter config as a follow up. Example - validate that action is a valid slack action, etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds a good one :)
will do

Comment thread slack-moderate-words/filters.yaml
@cpanato cpanato mentioned this pull request Feb 9, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 22, 2021
@k8s-ci-robot k8s-ci-robot merged commit 72f78a4 into kubernetes-sigs:master Feb 22, 2021
@cpanato cpanato deleted the GH-27 branch February 23, 2021 08:47
- triggers:
- guys
action: chat.postEphemeral
message: "May I suggest \"all\" instead when addessing a group of people? Thank you. :slightly_smiling_face:"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'all' can sound very strange in some sentences depending on how it is used. Its not a 1:1 replacement as sometimes you need to address a subset of people that isn't everyone which all implies. Another recommendation, though an older word, might be 'folks'? (https://www.merriam-webster.com/dictionary/folk, definition 1). I think its a pretty neutral term?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this PR is the right place to discuss this kind of thing. Maybe open a new issue or a thread in Slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List of words/phrases to auto-moderate

10 participants