Description of problem: The BitBucket Cloud version [1] is not sending the same type of X-Event-Key for a pus than the Server 5.4 version [2] [1] https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html [2] https://confluence.atlassian.com/bitbucketserver/event-payload-938025882.html OpenShift is not able to process these requests when the type is BitBucket. It does process them when the type is Generic. Version-Release number of selected component (if applicable): Openshift Container Platform 3.6 BitBucket Server 5.4 How reproducible: Always Steps to Reproduce: 1. Configure a BuildTrigger to use a bitbucket webhook 2. Configure a webhook on a Bitbucket 5.4 server 3. git push on the repository Actual results: Headers Date: Thu, 05 Oct 2017 05:59:21 GMT Cache-Control: no-store Content-Type: application/json Via: 1.1 localhost (Apache-HttpClient/4.4.1 (cache)) Content-Length: 162 Body {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unknown Bitbucket X-Event-Key repo:refs_changed","reason":"BadRequest","code":400} Expected results: Headers Date Mon, 09 Oct 2017 15:23:59 GMT Content-Length 1752 Content-Type text/plain; charset=utf-8 Cache-Control no-store Body {"kind":"Build","apiVersion":"build.openshift.io/v1","metadata":{"name":"example-2","namespace":"bitbucket-webhook","selfLink":"/oapi/v1/namespaces/bitbucket-webhook/buildconfigs/example-2/instantiate","uid":"dfa814e4-ad05-11e7-b9c8-123713f594ec","resourceVersion":"103224428","creationTimestamp":"2017-10-09T15:23:59Z","labels":{"app":"example","buildconfig":"example","openshift.io/build-config.name":"example","openshift.io/build.start-policy":"Serial"},"annotations":{"openshift.io/build-config.name":"example","openshift.io/build.number":"2"},"ownerReferences":[{"apiVersion":"build.openshift.io/v1","kind":"BuildConfig","name":"example","uid":"7010a15e-ad05-11e7-b9c8-123713f594ec","controller":true}]},"spec":{"serviceAccount":"builder","source":{"type":"Git","git":{"uri":"https://ruben-rh@bitbucket.org/ruben-rh/demo.git","ref":"master"}},"revision":{"type":"Git","git":{"commit":"16299257006b037ee8b5fefd3cda6b04803fb8ae","author":{},"committer":{},"message":"test created online with Bitbucket"}},"strategy":{"type":"Source","sourceStrategy":{"from":{"kind":"DockerImage","name":"registry.access.redhat.com/rhscl/nodejs-4-rhel7@sha256:51dbd18b3ae97a9d16a00d4566ce56a318a4001978dcc08b678b08751c861e35"}}},"output":{"to":{"kind":"ImageStreamTag","name":"example:latest"},"pushSecret":{"name":"builder-dockercfg-v45x0"}},"resources":{},"postCommit":{},"nodeSelector":null,"triggeredBy":[{"message":"Bitbucket WebHook","bitbucketWebHook":{"revision":{"type":"Git","git":{"commit":"16299257006b037ee8b5fefd3cda6b04803fb8ae","author":{},"committer":{},"message":"test created online with Bitbucket"}},"secret":"df59ce89***"}}]},"status":{"phase":"New","config":{"kind":"BuildConfig","namespace":"bitbucket-webhook","name":"example"},"output":{}}} Additional info:
according to the doc: A user pushes one or more commits to a repository. This payload, with an event key of repo:push, provides the following fields:
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/5cfb55eb7ddaba7a5ebb55347e5790f974ece2f8 add bitbucket v5.4 support bug 1500731 https://bugzilla.redhat.com/show_bug.cgi?id=1500731
Verified on ocp 3.7[1] with bitbucket 5.4 server.When push to repo,bitbucket webhook could trigger build successully without error. [1]openshift v3.7.0-0.188.0 kubernetes v1.7.6+a08f5eeb62
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:3188