juju-solutions / layer-cwr

Layer for building the Juju Jenkins CI env
Other
2 stars 5 forks source link

Run CWR against a PR #96

Closed ktsakalozos closed 7 years ago

ktsakalozos commented 7 years ago

New action adding a new jenkins job. The job is triggered by webhooks. Needs oauth to push messages back to the PR

pengale commented 7 years ago

When I try to build and run this code, I get an error. Everything seems to work -- all the actions specified in the README come back as successful, and my webhook makes its initial "hello there" request successfully. But when I create a PR, the webhook gets a 500 response.

Here is the output of the cwr-server.log. You can see a 200 when the webhook first pings the server, then a series of 500s as I tell github to redeliver the hook (there are also some 404s in there, which is me trying to hit the cwr results page in a browser, and failing because it hasn't been built yet.):

INFO:werkzeug:192.30.252.41 - - [24/Feb/2017 18:42:18] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 200 -
INFO:werkzeug:192.30.252.42 - - [24/Feb/2017 18:43:35] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 500 -
INFO:werkzeug:192.30.252.40 - - [24/Feb/2017 18:46:44] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 500 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:48:04] "GET / HTTP/1.1" 404 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:48:04] "GET /favicon.ico HTTP/1.1" 404 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:48:26] "GET / HTTP/1.1" 404 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:48:47] "GET / HTTP/1.1" 404 -
INFO:werkzeug:192.30.252.34 - - [24/Feb/2017 18:48:55] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 500 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:49:11] "GET /ci HTTP/1.1" 404 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:49:49] "GET / HTTP/1.1" 404 -
INFO:werkzeug:100.0.202.109 - - [24/Feb/2017 18:52:50] "GET / HTTP/1.1" 404 -
INFO:werkzeug:192.30.252.42 - - [24/Feb/2017 18:58:37] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 500 -
INFO:werkzeug:192.30.252.34 - - [24/Feb/2017 18:58:56] "POST /ci/v1.0/pr-trigger/pr_charm_openjdk/7d983673-c475-4403-8eba-338f46adba1e HTTP/1.1" 500

Here's the invocation that I used to setup the job:

juju run-action cwr/0 build-pr repo=https://github.com/petevg/layer-openjdk charm-name=openjdk controller=raven-aws reference-bundle=cs:~kwmonroe/bundle/ja
va-devenv oauth-token=<my oauth token>
ktsakalozos commented 7 years ago

You are making a valid point, our CWR server should return the reason why is gave out a 500.

In your case, can you make sure you select the PullRequest event on github when you create the webhook (just a guess).

kwmonroe commented 7 years ago

cwr-60 is in the edge channel. tests look good so far, but i haven't tried the oauth bits. that's coming...

ktsakalozos commented 7 years ago

Thank you for seeing this through @kwmonroe . I fixed the two point you mention above.

kwmonroe commented 7 years ago

Looks great! Comment made it over:

https://github.com/kwmonroe/layer-ubuntu-devenv/pull/1

This has been released to stable in cwr-61. Nice job @ktsakalozos!