Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-71903

Bitbucket Webhook starts new job on pipeline despite "Branches to build" configuration

XMLWordPrintable

      Hi,

      we have a pipeline configured with the following trigger

      and:

       

      And in Bitbucket, webhook looks as follows:

      This basically means we want to have pipeline executed every time something is pushed to "master" branch only.

      However we noticed that the pipeline is also triggered when:

      • any new branch is created
      • or any new push to those other branches is performed

      In both cases the event triggered by Bitbucket is : 

      X-Event-Key: repo:refs_changed

      "changes": [
              {
                  "fromHash": "c3a812f6132fb289616d1dfd2ea5d431fcca2553",
                  "ref": {
                      "displayId": "feature/anothertest",
                      "id": "refs/heads/feature/anothertest",
                      "type": "BRANCH"
                  },
                  "refId": "refs/heads/feature/anothertest",
                  "toHash": "bd191884f531a371688d3c9b3248a8a573f3d74d",
                  "type": "UPDATE"
              }
          ],
      ... 

       

      So it seems "Branches to build" is completely ignored and not taken into consideration when triggering the job.

      Could you please check if it is a bug indeed or it works as designed?

       

      Edit:

      One more thing to add regarding "Branches to build". It also seems that when we use env variables (ie. GIT_BRANCH) they are not evaluated later on.
      In result we can see the following at the very beginning of the job:

      git rev-parse refs/remotes/${GIT_BRANCH}^{commit} # timeout=10 

      and git, of course, fails to get anything.

      Not sure if those two things are related, just sharing so you have a full picture.

        1. image-2023-08-25-23-46-04-297.png
          13 kB
          Piotr Kulasek
        2. image-2023-08-25-23-46-36-771.png
          8 kB
          Piotr Kulasek
        3. image-2023-08-25-23-47-27-647.png
          18 kB
          Piotr Kulasek

            Unassigned Unassigned
            kulasekp Piotr Kulasek
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: