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

Jenkins build triggers but nothing changed in Included Regions

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • bitbucket-plugin
    • None
    • Jenkins 2.319.1
      git version 2.30.2
      bitbucket plugin 1.11.1

    Description

      Jenkins triggers builds of jobs even though the merge into Bitbucket does not include any files that are in the Included Regions values for the Jenkins jobs.   This happens often.  It might be a coincidence but the most recent time when this happened the jobs that triggered incorrectly were the jobs that had most recently triggered.  So

      Saturday 19 Feb - Merge commit X into master
      Jenkins triggers jobs A,B,C,D - correct
      Tuesday 22 Feb - Merge commit Y into master
      Jenkins triggers jobs A,B,C,D but these jobs should not have triggered because commit Y does not change any files in the Included Regions values of jobs A,B,C,D.

      Checked the Bitbucket webhook Request and it looks correct.  It does include

      "fromHash": "X", "toHash": "Y"

      Is Jenkins maybe triggering the jobs again based upon the "fromHash"?

       

       

      Attachments

        Activity

          tzach_solomon Tzach Solomon added a comment -

          fame as you can see from https://github.com/jenkinsci/bitbucket-plugin/blob/1492ad6ecc3de53b51f811bb16e83d6ac76c4809/src/main/java/com/cloudbees/jenkins/plugins/BitBucketTriggerRunnable.java#L46, we are calling hasChanges(), if it detects changes, we run build.

          Can you please provide more logs or the webhook body/headers?

          tzach_solomon Tzach Solomon added a comment - fame  as you can see from https://github.com/jenkinsci/bitbucket-plugin/blob/1492ad6ecc3de53b51f811bb16e83d6ac76c4809/src/main/java/com/cloudbees/jenkins/plugins/BitBucketTriggerRunnable.java#L46,  we are calling hasChanges(), if it detects changes, we run build. Can you please provide more logs or the webhook body/headers?
          fame adrian flynn added a comment - - edited

          Thanks Tzach.   

          Unfortunately I cannot share logs or webhook body/headers from our systems.  I will attempt to reproduce this on a test environment.

          >are calling hasChanges(), if it detects changes, we run build.

          There are changes in the merge but the changes are not in the Included Regions so the build should not happen.  I am not a Java developer but I will see can I get one of our devs to look at hasChanges().   I think I need to understand how hasChanges() decides if there have been changes.

          We are using https://github.com/jenkinsci/atlassian-bitbucket-server-integration-plugin.  I think haschanges() is called in Bitbucket plugin https://github.com/jenkinsci/bitbucket-plugin.

          We have Bitbucket plugin installed in Jenkins but I understood it is superceded by Bitbucket server integration plugin.

           

           

          fame adrian flynn added a comment - - edited Thanks Tzach.    Unfortunately I cannot share logs or webhook body/headers from our systems.  I will attempt to reproduce this on a test environment. >are calling hasChanges(), if it detects changes, we run build. There are changes in the merge but the changes are not in the Included Regions so the build should not happen.  I am not a Java developer but I will see can I get one of our devs to look at hasChanges().   I think I need to understand how hasChanges() decides if there have been changes. We are using https://github.com/jenkinsci/atlassian-bitbucket-server-integration-plugin.   I think haschanges() is called in Bitbucket plugin https://github.com/jenkinsci/bitbucket-plugin. We have Bitbucket plugin installed in Jenkins but I understood it is superceded by Bitbucket server integration plugin.    

          People

            tzach_solomon Tzach Solomon
            fame adrian flynn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: