Skip to content

Commit

Permalink
Merge pull request #5 from kevinthompson/kt/docs-improvements
Browse files Browse the repository at this point in the history
Update Documentation
  • Loading branch information
Daniel Ma authored Mar 29, 2017
2 parents daec41a + f6f435e commit dd211af
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 6 deletions.
63 changes: 57 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,86 @@
# Pull Request Review Reminder Bot

![Example Slack Message](https://raw.github.com/danielma/reviewbot/master/docs/images/slack-example.png)

Our team wants to be reminded via Slack about pending pull requests
after a certain number of work hours without activity. We calculate
work hours as the cumulative number of online hours since the pull
request was submitted.

## Setup

#### Create Github Access Token

1. Visit https://github.com/settings/tokens
2. Click "Generate New Token"
3. Select "repo" permissions

![Github Access Token Permissions](https://raw.github.com/danielma/reviewbot/master/docs/images/github-token-permissions.png)

#### Create Slack Legacy Token

1. Visit https://api.slack.com/custom-integrations/legacy-tokens
2. Issue a token if one does not exist

![Slack Legacy Token Generation](https://raw.github.com/danielma/reviewbot/master/docs/images/slack-token.png)

#### Configure Repos

```
cp sample-config.json config.json
```

Edit `config.json` to match the needs of your team. Each key in the configuration defines a repo, the channel messages for the repo should be posted to, the reviewers responsible for that repo, and the period of inactivity to notify reviewers after.

The `reviewers` key is a JSON array containing a github username, slack username, and timezone identifier for each reviewer.

##### Example Config

```json
{
"danielma/reviewbot": {
"room": "#reviewbot",
"reviewers": [
{
"github": "danielma",
"slack": "dma",
"timezone": "America/Los_Angeles"
},
{
"github": "contributor",
"slack": "dmas_evil_twin",
"timezone": "America/New_York"
}
],
"hours_to_review": 6
}
}
```

#### Create Application
```
git clone https://github.com/seven1m/reviewbot
git clone https://github.com/danielma/reviewbot
cd reviewbot
heroku apps:create NAME
heroku config:set \
GH_AUTH_TOKEN=abc-123 \
SLACK_TOKEN=xoxb-234 \
CONFIG=$(cat config.json)
CONFIG="$(cat config.json)"
git push heroku
heroku addons:create scheduler:standard
heroku addons:open scheduler
```

The `reviewers` key is a JSON an array with a github username, slack username, and timezone identifier.
![Heroku Scheduler Task Creation](https://raw.github.com/danielma/reviewbot/master/docs/images/heroku-scheduler.png)

Now add a schedule for hourly with the command `rake remind`.
## Testing

To test manually:
### Manual Test:

```
heroku run rake remind
```

## Copyright

Copyright Tim Morgan, Licensed MIT
Copyright Daniel Ma, Licensed MIT
Binary file added docs/images/github-token-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/heroku-scheduler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/slack-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/slack-token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dd211af

Please sign in to comment.