iangreenleaf / githubot

Github API access, tailored for Hubot
MIT License
106 stars 37 forks source link

Added support for github merge api #5

Closed rrinaldi closed 11 years ago

iangreenleaf commented 11 years ago

Cool! However, I need a test for it before I can merge. Think you could take a crack at that? It should probably go in test/repo.coffee - take a look at the "delete" test for an example to work off of. Let me know if you have trouble, and I can try to help.

rrinaldi commented 11 years ago

I can give it a shot. This is my first attempt at any coffescript/node work so I'm begging forgiveness now for any screwups.

iangreenleaf commented 11 years ago

Sure, no worries. I can clean up any small stuff. Hopefully it'll be a good learning experience :)

One more thing I forgot to mention: to run the tests, do roughly this:

cd path/to/githubot
npm install
make test
iangreenleaf commented 11 years ago

Any luck on the tests? I can probably just do em if you didn't get anywhere. If you're still working (or have questions), let me know.

maletor commented 11 years ago

Hey there is a related issue with how it responds to 204 statuses I found on the hubot integration script for this:

2013-02-27T17:19:36+00:00 app[web.1]: ^
2013-02-27T17:19:36+00:00 app[web.1]: 
2013-02-27T17:19:36+00:00 app[web.1]: 
2013-02-27T17:19:36+00:00 app[web.1]: undefined:0
2013-02-27T17:19:36+00:00 app[web.1]:     at Object.parse (native)
2013-02-27T17:19:36+00:00 app[web.1]:     at IncomingMessage.ScopedClient.request (/app/node_modules/githubot/node_modules/scoped-http-client/lib/index.js:70:20)
2013-02-27T17:19:36+00:00 app[web.1]:     at IncomingMessage.EventEmitter.emit (events.js:126:20)
2013-02-27T17:19:36+00:00 app[web.1]:     at IncomingMessage._emitEnd (http.js:366:10)
2013-02-27T17:19:36+00:00 app[web.1]: SyntaxError: Unexpected end of input
2013-02-27T17:19:36+00:00 app[web.1]:     at CleartextStream.socketOnData [as ondata] (http.js:1485:20)
2013-02-27T17:19:36+00:00 app[web.1]:     at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
2013-02-27T17:19:36+00:00 app[web.1]:     at CleartextStream.CryptoStream._push (tls.js:544:27)
2013-02-27T17:19:36+00:00 app[web.1]:     at EncryptedStream.CryptoStream.write (tls.js:285:13)
2013-02-27T17:19:36+00:00 app[web.1]:     at SecurePair.cycle (tls.js:898:20)
2013-02-27T17:19:36+00:00 app[web.1]:     at Github.request (/app/node_modules/githubot/githubot.coffee:58:23)
iangreenleaf commented 11 years ago

@maletor can you open a new issue with some details of how and where you got the error?

iangreenleaf commented 11 years ago

@rrinaldi Sorry I forgot about this for so long. I'm thinking about a slightly different API for this to integrate it with the other bespoke stuff I have so far:

gh.branches("foo/bar").merge "mybranch", cb # defaults to merging into "master"
gh.branches("foo/bar").merge "mybranch", into: "production", cb
gh.branches("foo/bar").merge "mybranch", into: "production", message: "Merging this awesome thing!", cb

How does that sound?

rrinaldi commented 11 years ago

Sounds good to me. Sorry for the lack of contact. Been uber busy.

Glad you were able to take care of this.