hubot-archive / hubot-bitbucket-pr

Hubot hollers whenever anything happens around a Bitbucket pull request
MIT License
14 stars 10 forks source link

TypeError: Cannot read property 'title' of undefined #12

Open jedipunkz opened 7 years ago

jedipunkz commented 7 years ago

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
madflow commented 7 years ago

You probably checked an unsupported trigger in the webhooks configuration in Bitbucket. I had a similar error when I had checked "Repository->push". Afaik only Pull Request and Issue Triggers actually do something with this script.

tshedor commented 7 years ago

@jedipunkz could you please confirm that you've only checked Pull Request and Issue Triggers in Bitbucket?

jedipunkz commented 7 years ago

Thanks for your info.

Okay, I'll try it again later. Please wait a moment until I feedback my info.

Thanks.

jedipunkz commented 7 years ago

I tried with only checking pull request and issue trigger, but nothing's happened.

I tried with these parameters.

run.sh

export PORT=XXXX
export HUBOT_BITBUCKET_PULLREQUEST_ROOM="infra-bot"
export HUBOT_BITBUCKET_PULLREQUEST_ANNOUNCE=created,updated,merged,comment_created,approve,unapprove

external-scripts.json

<snip>
  "hubot-bitbucket-pr",
<snip>

I will check a little more. If you have idea, Please tell me.

Thanks.

madflow commented 7 years ago

So it is the same error? When nothing happens - you are probably using the slack-adapter > 4.x. See #13

Assuming you want to use Slack...

wcoc commented 6 years ago

same problem here.