bubo is a HipChat bot that listens for mentions of JIRA or BitBucket tickets by issue key and expands the reference into something more readable.
This tool was originally created by Keith Fahlgren of Safari Books Online. It was hacked and slashed by Matt Warren to function with BitBucket. The current version will only connect to JIRA or BitBucket, not both!
- Joins a room (set defaults in
config.json
) - Checks each message for an upper-case JIRA issue key (
ABC-3
) or BitBucket issue key (repo-5
) - Responds with some contextual details from JIRA (https://something.atlassian.net/browse/ABC-3: "Support streaming reading" marked as Closed and assigned to Keith Fahlgren) * OR details from BitBucket (https://bitbucket.org/someone/repo/issue/5: "Something something broken stuff" marked as resolved and assigned to Matt Warren`)
###What if I want it in a new room?
- In a public room, mention it directly with
@jirabot
and wait for it to join - In a private room, invite it using the HipChat invite menu and wait for it to join
- Add it to the defaults in
config.json
if you want- Alternatively, to save the running config, use
@jirabot save
and find aconfig.runtime.json
in the runtime directory - You will need to copy the .runtime. config to the real deal. Overwriting configs automagically is scary.
- Alternatively, to save the running config, use
###What projects does it know about?
- Every JIRA project that you explicitly mention in
config.json
- Every BitBucket project it has access to for the BitBucket host user in
config.json
###What if I don't want it in a room?
- Too bad? Boot the user? Complain?
- Make a new user named
@jirabot
- Write down the XMPP details for
@jirabot
inconfig.json
- Have a JIRA user
- Write down the JIRA user details in
config.json
- Create a BitBucket user
- Write down the BitBucket user details in
config.json
mkdir node_modules
npm install
cp config.json.example config.json
$EDITOR config.json
- Make sure to remove the big comment block at the top
- Everything else should be documented in the config example
npm install -g nodemon
nodemon bubo_bot.js # runs and restarts if files change
npm install -g pm2
pm2 start bubo_bot.js -i 1 --name "bubo" # runs and restarts if the process dies
$ nodemon bubo_bot.js
2 Jun 02:32:18 - [nodemon] v1.1.1
2 Jun 02:32:18 - [nodemon] to restart at any time, enter `rs`
2 Jun 02:32:18 - [nodemon] watching: *.*
2 Jun 02:32:18 - [nodemon] starting `node bubo_bot.js`
Cannot load StringPrep-0.2.3 bindings (using fallback). You may need to `npm install node-stringprep`
-=- > Connect
-=- > Joining default room [email protected]
-=- > Joining default room [email protected]
-=- > Joining default room [email protected]
-=- > Invited to and joining [email protected] by [email protected]: hi @jirabot
-=- > Looking up JIRA details for How about ABC-1203 with matches: ABC-1203
To run on Heroku, do the normal (?) things but set the environment variables with config:add
instead of config.json.
Let's face it, nothing is perfect so if you need bubo to do something new, it can!
Drop a new js file in the plugins dir.
Your file MUST implement the following two methods:
is_match
which takes the message received by the bot and returns a booleanrespond
which takes the message received by the bot, the channel to respond in, and themessage
callback function
For an example, please see the super simple plugins/who.js
bubo is smart enough to find and load your js automatically.
If you have a plugin that you do not want tracked, you may use the private_plugins
directory.
If you use vim or another editor that creates a temporary file with .js in the name, you may find nodemon fails to restart the bot because of that file. The easiest way to deal with this right now is close your editor. Sorry.