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

Poll results in changes always found when using 2 global libraries

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin
    • P4 Plugin 1.9.3
      Jenkins 1.89.3

      When there are 2 or more global libraries P4Jenkins will use the same SyncID for both. This causes polling to always find a change even when no change has occurred.

      P4: Polling on: master with:jenkins-library
      Found last change 3 on syncID jenkins-library
      Found last change 2 on syncID jenkins-library
        ...cut...
      P4: Polling with range: 2,3
      ... p4 changes -m20 //jenkins-library/...@2,3 +
       ...cut...
      Changes found
      

      Reproduction Steps:

      (1) Under Manage Jenkins add two Helix based Libraries called 'my-shared-library' (org.foo.lib) and 'my-shared-library2' (org.bar.lib).

      (2) Create a Jenkinsfile that includes both libraries and uses one of them. For example:

      @Library('my-shared-library')
      @Library('my-shared-library2')
      import org.foo.lib.*
      import org.bar.lib.*
      pipeline {
        agent { label 'master' }
        stages {
          stage("Repro") {
            steps {
              script {
                 def z = new org.foo.lib()
                 z.testFunc1()
                 z.testFunc2()
              }
            }
          }
        }
      }
      

      (3) Create a pipeline job that uses the above Jenkinsfile and uses polling as the build trigger.

      (4) Manually run the build.

      (5) Wait for each poll interval.

      Result: A build is triggered for every poll.

      Expected Result: Only a change submitted to the libraries after step (4) should cause a poll to trigger a build.

       

       

            p4paul Paul Allen
            p4karl Karl Wirth
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: