Hide Forgot
Description of problem: Failed to start build from GitHub webhook URL which is correct Version-Release number of selected component (if applicable): openshift v1.4.0-alpha.0+e22007f How reproducible: Always Steps to Reproduce: 1. oc new-app https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-stibuild.json 2. Go to web console, go to build config page, check "Configuration" and copy the link of "Github webhook URL" 3. oc start-build --from-webhook="https://xxx.xxx.xxx.xxx:8443/oapi/v1/namespaces/xiaocwan-p/buildconfigs/ruby-sample-build/webhooks/secret101/github" 4. (only to compare) oc start-build --from-webhook="https://xxx.xxx.xxx.xxx:8443/oapi/v1/namespaces/xiaocwan-p/buildconfigs/ruby-sample-build/webhooks/secret101/generic" Actual results: 3. error: server rejected our request 500 remote: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Internal error occurred: hook failed: missing X-GitHub-Event or X-Gogs-Event","reason":"InternalError","details":{"causes":[{"message":"hook failed: missing X-GitHub-Event or X-Gogs-Event"}]},"code":500} 4. generic webhook succeed Expected results: 3. Should start build successfully Additional info: Please refer to attachment for log. This bug exposed when the bug https://bugzilla.redhat.com/show_bug.cgi?id=1373788 fixed
Tested against OCP openshift/oc 3.2.1.16, also reproduced this issue by Comment 1 steps. "--from-webhook" from both build config web page and `oc describe bc` lost the port, still github failed but generic succeed. # oc start-build --from-webhook=https://xxx.com/oapi/v1/namespaces/xiaocwan-p/buildconfigs/ruby-sample-build/webhooks/secret101/github -n xiaocwan-p error: server rejected our request 500 remote: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Internal error occurred: hook failed: missing X-GitHub-Event or X-Gogs-Event","reason":"InternalError","details":{"causes":[{"message":"hook failed: missing X-GitHub-Event or X-Gogs-Event"}]},"code":500}
oc start-build --from-webhook is only meant to work with the generic webhook. The CLI help needs to be updated to make this clear.
https://github.com/openshift/origin/pull/11822
verified with: openshift v3.4.0.25+1f36858 kubernetes v1.4.0+776c994 etcd 3.1.0-rc.0
$ oc start-build --from-webhook=https://xxx.amazonaws.com:8443/oapi/v1/namespaces/xiaocwan-t/buildconfigs/ruby-sample-build/webhooks/secret101/github warning: the '--from-webhook' flag should be called with a generic webhook URL. error: server rejected our request 400 remote: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"missing X-GitHub-Event, X-Gogs-Event or X-Gitlab-Event","reason":"BadRequest","code":400} generic webhook works normally Verified on origin oc v1.4.0-alpha.1+afb4f8d-181