status-im / status-github-bot

A bot for github
https://status-github-bot.herokuapp.com/
ISC License
11 stars 12 forks source link

add script to request reviews via comment #14

Closed martinklepsch closed 6 years ago

martinklepsch commented 6 years ago

via #4

First of all my JS is pretty horrible, which I just realized once again while working on this πŸ™ˆ

This PR solves the first part of #4 which is allowing users to request reviews using a comment. It currently takes mentions out of any comment starting with /review and requests a review from all mentioned users.

If any mentioned user is not in the Slack username mapping configuration the process will fail. If any user does not have write access to the repository the process will fail.

Probably worth doing:

I did test this using a project I created but since I can't request a review from myself I would have needed to add another person to the project which I might do eventually but haven't gotten around to yet.

In general I found that this project requires a lot of manual setup (Github App/Slack Team/Slack Integration) which is unfortunate and maybe a little bit annoying to new contributors. While it doesn't seem possible to automate those steps I believe it would be appropriate to have very detailed documentation how to set those things up. Whatever can be automated should be automated. (Project board setup etc.)

EDIT I know did some testing with another person and it seems that push access is required to create review requests πŸ€” Will need to add that...

martinklepsch commented 6 years ago

Re EDIT: It seems that GitHub is currently not allowing Apps to create review requests: https://github.com/probot/probot/issues/336#issuecomment-353247075 πŸ™ˆ

pedropombeiro commented 6 years ago

@martinklepsch wow, that's almost unbelievable that they haven't up opened that API for bots! I guess we could as a workaround use a user token for an unavailable operation like this. That token is already available in the form of process.env.SLACK_USER_TOKEN