Giter Club home page Giter Club logo

hubot-bitbucket-pr's Introduction

Hubot Bitbucket Pull Request

Holler whenever anything happens around a Bitbucket Pull Request or Issue

Build Status

Features

  • Notifies room when a pull request is created, commented, declined, merged, updated, approved or unapproved
  • Default room can be set with HUBOT_BITBUCKET_PULLREQUEST_ROOM
  • Pretty formatting if using the Slack adapter

Installation

In your hubot directory, run:

npm install hubot-bitbucket-pr --save

Then add hubot-bitbucket-pr to your external-scripts.json:

["hubot-bitbucket-pr"]

Configuration

Set up a Bitbucket Pull Request hook by checking all boxes and setting the URL to: {your_hubot_base_url}/hubot/bitbucket-pr

A default room can be set with HUBOT_BITBUCKET_PULLREQUEST_ROOM. If this is not set, a room param is required in the URL: ...bitbucket-pr?room={your_room_id}

Example

$ heroku config:add HUBOT_BITBUCKET_PULLREQUEST_ROOM=pull-requests
# If you're not on Heroku
$ export HUBOT_BITBUCKET_PULLREQUEST_ROOM=pull-requests

Pull Request Configuration

A list of announce events can be set with HUBOT_BITBUCKET_PULLREQUEST_ANNOUNCE. This comma-separated list sets what events hubot will share in the designated room. Possible options are:

  • created
  • updated
  • declined
  • merged
  • comment_created
  • approve
  • unapprove

If left blank, hubot will announce everything.

Issue Configuration

Issue-specific events can be appended to HUBOT_BITBUCKET_PULLREQUEST ANNOUNCE. Possible options are:

  • issue_created
  • issue_updated
  • issue_comment_created

Again, if left blank, hubot will announce everything.

Example

$ heroku config:add HUBOT_BITBUCKET_PULLREQUEST_ANNOUNCE=created,merged,issue_created
# If you're not on Heroku
$ export HUBOT_BITBUCKET_PULLREQUEST_ANNOUNCE=created,merged,issue_created

Commands

This is only a notifier, nothing more.

Notes

v0.3 >= required the Pull Request URL be set to ...bitbucket-pr?name={your_repo_name}. Bitbucket's Webhook 2.0 now includes the repo name in the API response; v0.4 <= removes this requirement as a non-breaking change.

Issue support is available in v1.0 <=.

Testing

Please add a test to test/bitbucket-pr_test.coffee before adding a new feature.

npm install
npm run test

hubot-bitbucket-pr's People

Contributors

bcelenza avatar madflow avatar monzou avatar tshedor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hubot-bitbucket-pr's Issues

TypeError: Cannot read property 'title' of undefined

hi,

I got this error. any idea ?

TypeError: Cannot read property 'title' of undefined
    at SlackPullRequestEvent.PullRequestEvent (/home/hubot/aa-bot-infra/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:65:37)
    at new SlackPullRequestEvent (/home/hubot/aa-bot-infra/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:183:58)
    at /home/hubot/aa-bot-infra/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:387:17
    at callbacks (/home/hubot/aa-bot-infra/node_modules/express/lib/router/index.js:164:37)
    at param (/home/hubot/aa-bot-infra/node_modules/express/lib/router/index.js:138:11)
    at pass (/home/hubot/aa-bot-infra/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/home/hubot/aa-bot-infra/node_modules/express/lib/router/index.js:173:5)
    at Object.router [as handle] (/home/hubot/aa-bot-infra/node_modules/express/lib/router/index.js:33:10)
    at next (/home/hubot/aa-bot-infra/node_modules/connect/lib/proto.js:174:15)
    at Object.multipart [as handle] (/home/hubot/aa-bot-infra/node_modules/connect-multiparty/index.js:42:27)
    at next (/home/hubot/aa-bot-infra/node_modules/connect/lib/proto.js:174:15)
    at Object.urlencodedParser [as handle] (/home/hubot/aa-bot-infra/node_modules/body-parser/lib/types/urlencoded.js:81:44)
    at next (/home/hubot/aa-bot-infra/node_modules/connect/lib/proto.js:174:15)
    at /home/hubot/aa-bot-infra/node_modules/body-parser/lib/read.js:121:5
    at invokeCallback (/home/hubot/aa-bot-infra/node_modules/raw-body/index.js:262:16)
    at done (/home/hubot/aa-bot-infra/node_modules/raw-body/index.js:251:7)
    at IncomingMessage.onEnd (/home/hubot/aa-bot-infra/node_modules/raw-body/index.js:307:7)
    at emitNone (events.js:86:13)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
npm --version
3.10.10

Can't use this module because of error:

Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: TypeError: Cannot read property 'display_name' of undefined
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at SlackPullRequestEvent.PullRequestEvent (/app/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:49:5, :51:35)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at new SlackPullRequestEvent (/app/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:171:3, :183:58)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at /app/node_modules/hubot-bitbucket-pr/src/bitbucket-pr.coffee:361:7, :388:17
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at callbacks (/app/node_modules/hubot/node_modules/express/lib/router/index.js:164:37)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at param (/app/node_modules/hubot/node_modules/express/lib/router/index.js:138:11)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at pass (/app/node_modules/hubot/node_modules/express/lib/router/index.js:145:5)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at Router._dispatch (/app/node_modules/hubot/node_modules/express/lib/router/index.js:173:5)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at Object.router (/app/node_modules/hubot/node_modules/express/lib/router/index.js:33:10)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:174:15)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at Object.multipart as handle
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:174:15)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at Object.urlencodedParser as handle
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:174:15)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at /app/node_modules/hubot/node_modules/express/node_modules/connect/node_modules/body-parser/lib/read.js:121:5
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at invokeCallback (/app/node_modules/hubot/node_modules/express/node_modules/connect/node_modules/body-parser/node_modules/raw-body/index.js:262:16)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at done (/app/node_modules/hubot/node_modules/express/node_modules/connect/node_modules/body-parser/node_modules/raw-body/index.js:251:7)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at IncomingMessage.onEnd (/app/node_modules/hubot/node_modules/express/node_modules/connect/node_modules/body-parser/node_modules/raw-body/index.js:308:7)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at IncomingMessage.emit (events.js:92:17)
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at _stream_readable.js:944:16
Apr 25 06:13:46 titanium-hubot-for-slack app/web.1: at process._tickCallback (node.js:458:13)

Add issue tracker notifications

Hi there!
Is it possible to notify issues as you do for pull requests?

Thank you for your help (and for this great script :-) )

Publish the new version on NPM?

Hey, loving this plugin in particular - The the latest version (0.5.2) isn't yet available on NPM - Could you please push this? ๐Ÿ˜„

How to install from this repo?

Hey all,

Not sure of the best place to ask this question.

When I run npm install hubot-bitbucket-pr --save as suggested in the README I seem to get version 0.2.0 and I'm not sure where it's pulling from. To get a newer version I have to download the script and manually put it in my /scripts folder. I see that there's a version 0.3.0 and 0.4.0 in this repo. What's the recommended way to upgrade?

I'm new to Hubot so I apologize if this is a total newbie question.

More detailed documentation

Hey,

i'm using Hubot for rocket chat and i'm guessing what the hubot base url could be.

Also, if self hosted bitbucket server, which hook addon should i use with which options?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.