New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BitBucket trigger gets empty response body with 200 status when ref doesn't match branch name #21218

Open
matihost opened this Issue Oct 11, 2018 · 1 comment

Comments

Projects
None yet
4 participants
@matihost

matihost commented Oct 11, 2018

BitBucket trigger gets empty response body with 200 status when ref doesn't match branch name.

Expected result should be some 40x error or at least 200 body with information that the build was not triggered because ref doesn't match provided ref.

If it cannot be done due to backward compatibility concerns, or other concerns,
please provide a flag to BuildConfig trigger to show it, because lack of this feature and literally one sentence hidden in documentation - causes a misunderstanding.
Normally 200 means success.

Version

OKD 3.10

Steps To Reproduce
  1. Create BC with
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: someName
spec:
  failedBuildsHistoryLimit: 2
  successfulBuildsHistoryLimit: 1
  runPolicy: Parallel
  source:
    git:
      ref: 'master'
      uri: 'ssh://git@sooemomsoe.url/project/repo.git'
    type: Git
  strategy:
    jenkinsPipelineStrategy:
      jenkinsfile: |
        #!groovy
        node("maven"){
		....
        }
    type: JenkinsPipeline
  
  triggers:
    - bitbucket:
        secretReference:
          name: mysecret
      type: Bitbucket
  1. Either configure BitBucket Webhook to be triggered on other branches than the one mentioned in ref
    or call something like this :
    curl -vskL -H "X-Hub-Signature: sha256=e530alaMaKota42" -H "X-Request-Id: 9kotMaAle8c" -H "Content-Type: application/json" -H "X-Event-Key: repo:refs_changed" https://routerUrl/oapi/v1/namespaces/nsName/buildconfigs/bcName/webhooks/secretvalue1/bitbucket -d '{"eventKey":"repo:refs_changed","date":"2018-10-11T04:40:37-0500","actor":{"name":"ala","emailAddress":"some@some.com","id":3917,"displayName":"superman","active":true,"slug":"batman","type":"NORMAL"},"repository":{"slug":"repoName","id":13073,"name":"repoName","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":true,"project":{"key":"ALA","id":5563,"name":"MaKota","description":"ALAmaKota","public":false,"type":"NORMAL"},"public":false},"changes":[{"ref":{"id":"refs/heads/feature/somefeature","displayId":"feature/somefeature","type":"BRANCH"},"refId":"refs/heads/feature/somefeature","fromHash":"222bb13e(....)f80","toHash":"574(...)2b","type":"UPDATE"}]}'
Current Result
HTTP/1.1 200 OK
Cache-Control: no-store
Date: Thu, 11 Oct 2018 12:39:13 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8

Expected Result

Expected result should be some 40x error or at least 200 body with information that the build was not triggered because ref doesn't match provided branch ref.

@jwforres

This comment has been minimized.

Show comment
Hide comment
Member

jwforres commented Oct 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment