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

Webhook pushes from other branches cause master branch pipeline to run


    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • bitbucket-plugin
    • None
    • Jenkins 2.235.5
      Bitbucket Plugin 1.1.27

      Hi, we have this plugin configured to be executed when we push changes to master branch only.


      Sometimes  (once, twice per week) this pipeline is executed automatically when we push changes into other branches (on same repository). We cannot find any behaviour to reproduce it... It's happens only few times.

      This behaviour started few weeks ago automatically. We updated Jenkins and plugins to the last version and it's still happens.


      We enabled webhooks logs at Bitbucket and we didn't see troubles there... The payload seams correct (contains branch name, and commit hash are correct to the related branch)

       Also we enable more verbose logs in Jenkins, this is what we see:

      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processPayload
      Processing new Webhooks payload
      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketPayloadProcessor processWebhookPayload
      Received commit hook notification for {"scm":"git","website":"","uuid":"{be286268-cf76-4046-a33e-9bdc8e4745ff}","links":{"self":
      Nov 17, 2020 7:38:23 AM INFO com.cloudbees.jenkins.plugins.BitbucketJobProbe triggerMatchingJobs 
      Triggering BitBucket job backend-deploy

       Note: "backend-deploy" is our master branch pipeline 


      This is our pipeline configuration


      Note: When we do a "merge to master" manually from our branches this jobs is executed correctly. As I said before, "sometimes" runs automatically when push changes into other branches (non-master).


      These are screenshots from Bitbucket webhooks history


        1. image-2020-11-17-10-44-09-574.png
          27 kB
          Carlos Coronado
        2. image-2020-11-17-10-44-53-223.png
          60 kB
          Carlos Coronado
        3. image-2020-11-17-10-55-49-143.png
          31 kB
          Carlos Coronado
        4. image-2020-11-17-10-57-32-235.png
          106 kB
          Carlos Coronado

            tzach_solomon Tzach Solomon
            carlos_mt Carlos Coronado
            0 Vote for this issue
            3 Start watching this issue