rjz / hubroulette

Code review roulette!
Other
1 stars 0 forks source link

Panics on new pull request #12

Closed dylanpyle closed 6 years ago

dylanpyle commented 6 years ago

I believe everything's hooked up correctly, and the test event works fine:

2018-09-25T17:50:36.321601+00:00 heroku[router]: at=info method=POST path="/hooks/github" host=cala-hubroulette.herokuapp.com request_id=10ce17a5-9c9b-40ff-afc8-40c66b7f2e29 fwd="192.30.252.44" dyno=web.1 connect=1ms service=2ms status=200 bytes=138 protocol=https
2018-09-25T17:50:36.319627+00:00 app[web.1]: 2018/09/25 17:50:36 Saw unknown event 'ping' and waved as it went by.

But an actual PR event fails loudly:

2018-09-25T17:50:56.939649+00:00 app[web.1]: panic: runtime error: invalid memory address or nil pointer dereference
2018-09-25T17:50:56.939820+00:00 app[web.1]: [signal 0xb code=0x1 addr=0x0 pc=0x4048ff]
2018-09-25T17:50:56.939836+00:00 app[web.1]:
2018-09-25T17:50:56.939899+00:00 app[web.1]: goroutine 11 [running]:
2018-09-25T17:50:56.940031+00:00 app[web.1]: main.HandlePullRequestEvent(0xc20803cc60, 0x0, 0x0)
2018-09-25T17:50:56.940147+00:00 app[web.1]: /tmp/tmp.q41kHwYJJh/.go/src/github.com/rjz/hubroulette/pull_request_handler.go:58 +0x113f
2018-09-25T17:50:56.940193+00:00 app[web.1]: created by main.func·001
2018-09-25T17:50:56.940326+00:00 app[web.1]: /tmp/tmp.q41kHwYJJh/.go/src/github.com/rjz/hubroulette/main.go:49 +0x9f
2018-09-25T17:50:56.940343+00:00 app[web.1]:
2018-09-25T17:50:56.940411+00:00 app[web.1]: goroutine 1 [IO wait]:
2018-09-25T17:50:56.940577+00:00 app[web.1]: net.(*pollDesc).Wait(0xc208010220, 0x72, 0x0, 0x0)
2018-09-25T17:50:56.940688+00:00 app[web.1]: /usr/local/go/src/net/fd_poll_runtime.go:84 +0x47
2018-09-25T17:50:56.940693+00:00 app[web.1]: net.(*pollDesc).WaitRead(0xc208010220, 0x0, 0x0)
2018-09-25T17:50:56.940716+00:00 app[web.1]: /usr/local/go/src/net/fd_poll_runtime.go:89 +0x43
2018-09-25T17:50:56.940743+00:00 app[web.1]: net.(*netFD).accept(0xc2080101c0, 0x0, 0x7fb9ba65ab70, 0xc20802ae58)
2018-09-25T17:50:56.940748+00:00 app[web.1]: /usr/local/go/src/net/fd_unix.go:419 +0x40b
2018-09-25T17:50:56.940761+00:00 app[web.1]: net.(*TCPListener).AcceptTCP(0xc20803e020, 0x4ec8be, 0x0, 0x0)
2018-09-25T17:50:56.940772+00:00 app[web.1]: /usr/local/go/src/net/tcpsock_posix.go:234 +0x4e
2018-09-25T17:50:56.940848+00:00 app[web.1]: net/http.tcpKeepAliveListener.Accept(0xc20803e020, 0x0, 0x0, 0x0, 0x0)
2018-09-25T17:50:56.940853+00:00 app[web.1]: /usr/local/go/src/net/http/server.go:1976 +0x4c
2018-09-25T17:50:56.940890+00:00 app[web.1]: net/http.(*Server).Serve(0xc208030180, 0x7fb9ba65bff8, 0xc20803e020, 0x0, 0x0)
2018-09-25T17:50:56.940911+00:00 app[web.1]: /usr/local/go/src/net/http/server.go:1728 +0x92
2018-09-25T17:50:56.940920+00:00 app[web.1]: net/http.(*Server).ListenAndServe(0xc208030180, 0x0, 0x0)
2018-09-25T17:50:56.940931+00:00 app[web.1]: /usr/local/go/src/net/http/server.go:1718 +0x154
2018-09-25T17:50:56.940998+00:00 app[web.1]: net/http.ListenAndServe(0xc20802aa20, 0x6, 0x0, 0x0, 0x0, 0x0)
2018-09-25T17:50:56.941003+00:00 app[web.1]: /usr/local/go/src/net/http/server.go:1808 +0xba
2018-09-25T17:50:56.941022+00:00 app[web.1]: main.main()
2018-09-25T17:50:56.941043+00:00 app[web.1]: /tmp/tmp.q41kHwYJJh/.go/src/github.com/rjz/hubroulette/main.go:71 +0x321
2018-09-25T17:50:57.008252+00:00 heroku[web.1]: Process exited with status 2
rjz commented 6 years ago

Hey @dylanpyle, thanks for reporting this! Before digging in too deep, could you double-check that the webhook's configured to post JSON?

dylanpyle commented 6 years ago

@rjz aha, it was not! Great catch. Will try another run now.

dylanpyle commented 6 years ago

Beautiful - it works great. Having issues with Slack but that's likely a misconfiguration on my end. I think 08c4998 is the right answer here.

rjz commented 6 years ago

Thanks, @dylanpyle! Now to get that commit through CI and on to victory...