andrewtarry / hubot-bitbucket

Hubot library to listent for Bitbucket hooks
MIT License
4 stars 4 forks source link

ERROR Unable to load /app/node_modules/hubot-bitbucket/src/push-hook: ReferenceError: bitbucketPush is not defined #1

Open GabLeRoux opened 9 years ago

GabLeRoux commented 9 years ago

Hey there, I've added "hubot-bitbucket" to my external-scripts.json file and ran npm install --save hubot-bucket, git push (using heroku) and

2015-06-27T18:23:10.953301+00:00 heroku[web.1]: Starting process with command `bin/hubot --adapter slack`
2015-06-27T18:23:12.620490+00:00 app[web.1]: Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)
2015-06-27T18:23:12.620510+00:00 app[web.1]: Recommending WEB_CONCURRENCY=1
2015-06-27T18:23:15.458046+00:00 app[web.1]: [Sat Jun 27 2015 18:23:15 GMT+0000 (UTC)] INFO Connecting...
2015-06-27T18:23:15.612776+00:00 app[web.1]: [Sat Jun 27 2015 18:23:15 GMT+0000 (UTC)] INFO Logged in as hubot of <SNIP>, but not yet connected
2015-06-27T18:23:15.752763+00:00 app[web.1]: [Sat Jun 27 2015 18:23:15 GMT+0000 (UTC)] INFO Slack client now connected
2015-06-27T18:23:15.976319+00:00 heroku[web.1]: State changed from starting to up
2015-06-27T18:23:16.261623+00:00 app[web.1]: [Sat Jun 27 2015 18:23:16 GMT+0000 (UTC)] INFO hubot-redis-brain: Discovered redis from REDISCLOUD_URL environment variable
2015-06-27T18:23:16.832932+00:00 app[web.1]: [Sat Jun 27 2015 18:23:16 GMT+0000 (UTC)] ERROR Unable to load /app/node_modules/hubot-bitbucket/src/push-hook: ReferenceError: bitbucketPush is not defined
2015-06-27T18:23:16.832938+00:00 app[web.1]:   at module.exports (/app/node_modules/hubot-bitbucket/src/push-hook.coffee:25:3, <js>:10:30)
2015-06-27T18:23:16.832940+00:00 app[web.1]:   at Robot.loadFile (/app/node_modules/hubot/src/robot.coffee:253:11, <js>:177:13)
2015-06-27T18:23:16.832942+00:00 app[web.1]:   at /app/node_modules/hubot-bitbucket/index.coffee:12:11, <js>:26:33

Also tried with HUBOT_BITBUCKET_PUSH_URL and HUBOT_BITBUCKET_PUSH_EVENT set to defaults but still getting this.

GabLeRoux commented 9 years ago

Seems like https://github.com/andrewtarry/hubot-bitbucket/blob/master/src/push-hook.coffee#L25

robot.router.post bitbucketPush, (req, res) ->

should be

robot.router.post bitbucketPushUrl, (req, res) ->

Trying this and I'll send a pr if it works :)

foxlance commented 7 years ago

@GabLeRoux seems like the repository is inactive. Any chance you've found an alternative?

GabLeRoux commented 7 years ago

@foxlance You can use my fork gableroux/hubot-bitbucket.

Install using the following command instead:

npm install gableroux/hubot-bitbucket --save

Or add the following to your package.json:

  "dependencies": {
    "hubot-bitbucket": "github:gableroux/hubot-bitbucket"
  }

I don't know about the author here, but it's possible that he's not using his repo anymore.

I remember that back in the days, there was a problem with slack not displaying nice links so the output looked a bit ugly (huge), but I suppose they fixed it now (2 years later). My fork should still work. I'm not using it anymore as it was making quite some noise and I prefer using my CI to notify in slack or discord.

foxlance commented 7 years ago

@GabLeRoux thanks! That certainly fixed my crashing heroku instance. Will play with this a little more till I get sleepy.

GabLeRoux commented 7 years ago

Cool, have fun and don't hesitate to ask me questions. If you go trough webhooks code, you may find this repository helpful. I created it to have actual json data from bitbucket webhooks to play with (but you're better with real webhooks imho as bitbucket could have changed its api now).

foxlance commented 7 years ago

Gave the other one hubot-bitbucket-pr a shot, and while I'm getting 204, nothing is happening. Id rather just create my own webhooks, exactly like you suggested.