Neurophysiologically Pseudoscientific Manatee
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

oden-boy

0.2.9 • Public • Published

Oden

Bot for Slack to select reviewers. If you send the URL of PR to Bot, we will pick two reviewers and add them to Assignees of Github.

Features

  • Use the Slack API and Github API.
  • Randomly select 2 online users for review channel.
  • Correspondence table of Slack and Github ID is obtained by team.json of Git.
  • Adjust so as not to consecutively make the same person reviewer.

Running oden Locally

1.You can start oden locally by running:

git clone https://github.com/s1160054/oden.git
cd oden
HUBOT_SLACK_TOKEN=xxxx GIT_API_TOKEN=yyyy NAME_OF_ADMINS_GIT=<your_git_name> bin/hubot --adapter slack

2.Edit this file to correspond to your team member: team.json

{
  "your_github_user_name": "your_slack_name",
  "sakuya": "izayoi.sakuya",
  "yukari": "yukari.yakumo",
  "meiling": "hong.meiling",
  "reimu": "reimu.hakurei"
}

Or if you want to make this JSON file private:

Please put the json file for the team in github and do like this.

TEAM_JSON_URL=https://github.com/your_name/repo_name/blob/master/team.json

Commands

Cmd Description
URL of Pull-request I choose two reviewers and assign them.
users User's status display.
user+(.*) Add to reviewable users. 
user+me
user+sakuya, reimu
user-(.*) Add users that can not be reviewed today.
user-me
user-sakuya, reimu
user!-(.*) Keep users from reviewing at all times.
user!-me
user!-sakuya, reimu
user!+(.*) Always to revive the users who can not review.
user!+me
user!+sakuya, reimu
config Display the bot setting.

Configuration

Required

Config Variable
HUBOT_SLACK_TOKEN https://my.slack.com/apps/A0F7YS25R-bots
GIT_API_TOKEN https://github.com/settings/tokens
NAME_OF_ADMINS_GIT your_git_name

Optional

Config Variable Default value
REVIEW_CHANNEL random
Name of the channel where the reviewer is located
NUMBER_OF_REVIEWERES Two persons(2)
Number of people required for review
FETCH_INTERVAL Every 10 minutes('0 */10 * * * *')
Interval to check user's online
SKIP_INTERVAL Daily 0:00('0 0 0 * * *')
Interval to restore skipped users
CLEAR_INTERVAL Every hour('0 59 * * * *')
The interval to remove offline users from users
ALERT_INTERVAL Daily 17:00('0 14 * * * *')
Periodic notification
DB_PATH ./db.json
Path of JSON file for persistence
TEAM_JSON_URL ./team.json or https://github.com/your_name/repo_name/blob/master/team.json
ID linking Slack and GIt URL or Path
REQUEST_WORDING Please review this pull request
NEVER_USERS Keep users from reviewing at all times

Install as a npm package

npm install oden-boy

oden-boy

install

npm i oden-boy

Downloadsweekly downloads

27

version

0.2.9

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability