» Introduction
review-bot sends a reminder message to Mattermost or Slack with all open pull/merge requests which need an approval. Well suitable for running as a cron-job, e.g. for daily reminders.
This tool is still beta. The usage with Gitlab and Mattermost is more mature while the Github and Slack usage is an early preview.
» Installation
| |
» Example
» Sample Output for Gitlab and Mattermost
» Project Name
How-To: Got reminded? Just normally review the given merge request with 👍/👎 or use 😴 if you don’t want to receive a reminder about this merge request.
Support SHIELD
1 💬 3 👍 @hulkAsk Deadpool to join us
3 💬 3 👍 @batmanRepair the Helicarrier
3 💬 @hulk @batman @groot @iron_manFind Kingpin
2 💬 4 👍 You got all reviews, @daredevil.
» Configuration
The reviewers.json file contains the gitlab/github user name as key and the mattermost name or slack user id as value.
Example 1: github/gitlab username and mattermost name
| |
Example 2: github/gitlab username and slack id
| |
» Running
Get all open merge requests from the Gitlab project owner/repo and post the resulting reminder to the specified Mattermost channel:
| |
» Command Line Flags
| |
» Templates
We use the Go template package for parsing. Depending on which backend you use, there are different fields you can use. Check the examples folder for a quick overview.
» Gitlab
Accessing {{.Project}} gives you access to these fields.
While {{range .Reminders}} gives you access to {{.MR}} which is the merge request. {{.Missing}} is the Slack/Mattermost handle of the missing reviewer. {{.Discussions}} is the number of open discussion. {{.Owner}} is the Mattermost name of the assignee or otherwise the creator of the merge request. {{.Emojis}} is a map with the reacted emoji’s and their count on this merge request.
The corresponding Go structs:
| |
» Github
Accessing {{.Repository}} gives you access to these fields.
While {{range .Reminders}} gives you access to {{.PR}} which is the pull request. {{.Owner}} the Mattermost name of the PR creator or the Github login as fallback. {{.Missing}} is the Slack/Mattermost handle of the missing reviewer.
| |