alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
806 stars 72 forks source link

Add messages option #125

Closed martindekov closed 5 years ago

martindekov commented 5 years ago

Adding messages option to the derek bot in order to apply tempaltes or boilerplate things that we write all the time.

Signed-off-by: Martin Dekov (VMware) mdekov@vmware.com

Description

Extending the comments handler, by passing the derek config file (.DEREK.yml), in order to take the messages field from it and pass it to the executing function which sends the message to the Issue.

Motivation and Context

Closes #109

How Has This Been Tested?

Manually multi line literal value of the message: image

Note in order for this to work, the string literal should be placed just below the | like so:

message:
- name: slack
value: |
--
Join Slack to connect with the community
https://docs.openfaas.com

If we go like this, this will lead to parsing error

message:
- name: slack
value: |
--
Join Slack to connect with the community
https://docs.openfaas.com

Manually single line value of message: image

Whole content of .DEREK.yml: image

Image is here martindekov/derek:0.0.7, in order to test augment your .DEREK.yml file like pointed in the picture above and swap the images.

Types of changes

Checklist:

alexellis commented 5 years ago

In the YAML files perhaps message should be messages?

Could we have an alias of Derek msg, what do you think? I use GitHub a lot on mobile, less typing is better for me.

martindekov commented 5 years ago

Yes Alex your proposals are great I will add those.

martindekov commented 5 years ago

Change added and tested:

image Response:

image

When trying to add message whic is not applied, response reads:

image

martindekov commented 5 years ago

Also the config:

image

alexellis commented 5 years ago

/set reviewer: rgee0

martindekov commented 5 years ago

Thank you @rgee0 I will refer your comments tomorrow. I am open to suggestions on naming the feature. I went with message as it was mostly discussed in the Issue.

alexellis commented 5 years ago

I think:

Feature toggle and definition within YAML: custom_messages or just messages User command: /message /msg

Does that work? I think it's what Martin landed on

rgee0 commented 5 years ago

Using message as the command wasn't mentioned once on #109.

@martindekov if this is meant to be a separate feature then there's further rework required. If I ask how a user would use the message command without enabling comments then that should get you thinking in the right area.

alexellis commented 5 years ago

You're right. I think this doesn't need to be a toggle, but the feature should be documented with the names as per above.

alexellis commented 5 years ago

You are correct again, I suggested "topic" as the command, but Martin chose "message" and I'm ok with that choice.

martindekov commented 5 years ago

What I might have seen that somewhere else not sure why I got message in my head I apologise I will swap that for sure.

martindekov commented 5 years ago

I will go with topic

alexellis commented 5 years ago

I preferred your suggestion of /message and /msg. Please can you keep that as it is?

alexellis commented 5 years ago

To clarify: https://github.com/alexellis/derek/issues/109#issuecomment-508987654

martindekov commented 5 years ago

Thank you @rgee0 for the extended review. I will need to test the change before it is good to go. If you have any more comments let me know. 💯

martindekov commented 5 years ago

Also tested e2e on my repo I believe if there are no further commends this is good to go :+1:

alexellis commented 5 years ago

Merged 👍 thank you Martin