Strider-CD / strider-bitbucket

Bitbucket git provider for Strider
17 stars 15 forks source link

TypeError: Cannot read property 'raw_author' of undefined on commit hook #17

Open anton-siardziuk opened 9 years ago

anton-siardziuk commented 9 years ago

When I push new branch, or merge this branch to staging, eveything works fine.

When I try to push to master fast-forwarded merge from staging, I got this in logs:

2015-03-26T07:03:52.531Z - error: TypeError: Cannot read property 'raw_author' of undefined
    at postPayload (/usr/local/lib/node_modules/strider/node_modules/strider-bitbucket/lib/api.js:154:34)
    at Object.startCommitJob (/usr/local/lib/node_modules/strider/node_modules/strider-bitbucket/lib/api.js:182:14)
    at /usr/local/lib/node_modules/strider/node_modules/strider-bitbucket/webapp.js:187:11
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/strider/node_modules/express/lib/router/layer.js:82:5)
    at next (/usr/local/lib/node_modules/strider/node_modules/express/lib/router/route.js:110:13)
    at projectProvider (/usr/local/lib/node_modules/strider/lib/middleware.js:123:3)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/strider/node_modules/express/lib/router/layer.js:82:5)
    at next (/usr/local/lib/node_modules/strider/node_modules/express/lib/router/route.js:110:13)
    at Promise.<anonymous> (/usr/local/lib/node_modules/strider/lib/middleware.js:249:7)
    at Promise.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
    at Promise.EventEmitter.emit (events.js:95:17)
    at Promise.emit (/usr/local/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/usr/local/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
    at Promise.resolve (/usr/local/lib/node_modules/strider/node_modules/mongoose/lib/promise.js:114:23)
    at Promise.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
    at Promise.EventEmitter.emit (events.js:95:17)
POST /<project/repo>/api/bitbucket/commit/<secret> 500 33.957 ms - -
chevett commented 9 years ago

I am having the same problem here. I push to dev branch. Then if it all looks good I push to master, but strider fails with the raw_author message.

chevett commented 9 years ago

This appears to be a bug with bitbucket. The commits array from bitbucket is empty, so there is no way to tell strider what to build.

There appears to be a new webhooks api from bitbucket. Perhaps that works correctly?

svenvarkel commented 8 years ago

I'm able to reproduce this error so that I make 2 commits and pushes to the same projects to different branches. It occurs after 2nd push.

The order of pushes does not matter. It fails on the 2nd push every time.

--- (after searching and debugging around) ---

I found the reason of this problem:

  1. it occurs after merging/pushing the same commit to multiple branches
  2. BitBucket API seems to be sending ONE message per commit with proper payload

this Strider API gets notified with proper payload only on the first event and with empty commit payload on subsequent push events.

The logic of commit triggers must be changed to cope with this (thinking)