{"action":"closed","issue":{"url":"https://api.github.com/repos/openshift/origin/issues/1317","labels_url":"https://api.github.com/repos/openshift/origin/issues/1317/labels{/name}","comments_url":"https://api.github.com/repos/openshift/origin/issues/1317/comments","events_url":"https://api.github.com/repos/openshift/origin/issues/1317/events","html_url":"https://github.com/openshift/origin/issues/1317","id":62025371,"number":1317,"title":"webhooks to work with gogs and github projects","user":{"login":"jstrachan","id":30140,"avatar_url":"https://avatars.githubusercontent.com/u/30140?v=3","gravatar_id":"","url":"https://api.github.com/users/jstrachan","html_url":"https://github.com/jstrachan","followers_url":"https://api.github.com/users/jstrachan/followers","following_url":"https://api.github.com/users/jstrachan/following{/other_user}","gists_url":"https://api.github.com/users/jstrachan/gists{/gist_id}","starred_url":"https://api.github.com/users/jstrachan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jstrachan/subscriptions","organizations_url":"https://api.github.com/users/jstrachan/orgs","repos_url":"https://api.github.com/users/jstrachan/repos","events_url":"https://api.github.com/users/jstrachan/events{/privacy}","received_events_url":"https://api.github.com/users/jstrachan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-03-16T09:33:08Z","updated_at":"2015-05-08T15:16:54Z","closed_at":"2015-05-08T15:16:54Z","body":"we've been trying to setup [gogs](http://gogs.io/) which uses github style webhooks so that a git push in gogs results in a new build in OpenShift. There's no errors in openshift but the webhook request is ignored. \r\n\r\nHowever we can use the webhook REST API (generic) without passing any payload and it works fine - a build is actually triggered. (We use this in hawtio-kubernetes to trigger new builds and it works fine).\r\n\r\nHowever both github and gogs post a blob of JSON when they fire a webhook which seems to not get parsed correctly by OpenShift meaning the webhook doesn't result in a new build and there's no error in the log to indicate whats wrong. \r\n\r\nIts far better if in doubt, to trigger a new build. I can imagine various git / scm hosting solutions posting various JSON blobs & its better to assume its a well intentioned attempt to trigger a build than just ignore the request and not to log any useful information about why the request was ignored ;)\r\n\r\nSo can we either:\r\n\r\n* make the webhook work even if the code can't parse the JSON correctly (despite it being valid JSON - just not of the expected shape)\r\n* have a new webhook API (or query argument) which ignores the payload if any is posted and just trigger a new build?\r\n\r\nIdeally having better logging would help too so that we've a clue trying to diagnose why webhooks don't work; there's no errors in the openshift log right now when gogs invokes it.\r\n\r\nFWIW here's an example blob of JSON sent from gogs:\r\n\r\n```\r\n{\r\n  \"secret\":\"secret101\",\r\n  \"ref\": \"refs/heads/master\",\r\n  \"commits\": [{\r\n    \"id\": \"0330eeb868d42499ecfad174f415aabd166f16af\",\r\n    \"message\": \"testing webhook\\n\",\r\n    \"url\": \"http://localhost:3000/jstrachan/lager1/commit/0330eeb868d42499ecfad174f415aabd166f16af\",\r\n    \"author\": {\r\n      \"name\": \"James Strachan\",\r\n      \"email\": \"james.strachan@gmail.com\",\r\n      \"username\": \"jstrachan\"\r\n    }\r\n  }],\r\n  \"repository\": {\r\n    \"id\": 2,\r\n    \"name\": \"lager1\",\r\n    \"url\": \"http://localhost:3000/jstrachan/lager1\",\r\n    \"description\": \"\",\r\n    \"website\": \"\",\r\n    \"watchers\": 1,\r\n    \"owner\": {\r\n      \"name\": \"jstrachan\",\r\n      \"email\": \"james.strachan@gmail.com\",\r\n      \"username\": \"jstrachan\"\r\n    },\r\n    \"private\": false\r\n  },\r\n  \"pusher\": {\r\n    \"name\": \"jstrachan\",\r\n    \"email\": \"james.strachan@gmail.com\",\r\n    \"username\": \"jstrachan\"\r\n  },\r\n  \"before\": \"826aa9e6424006faff9440b4cd336aaf72de8136\",\r\n  \"after\": \"0330eeb868d42499ecfad174f415aabd166f16af\",\r\n  \"compare_url\": \"http://localhost:3000/jstrachan/lager1/compare/826aa9e6424006faff9440b4cd336aaf72de8136...0330eeb868d42499ecfad174f415aabd166f16af\"\r\n}```\r\n"}}