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

Branch indexing does not poll its generated subitems

      The attached Jenkinsfile performs an additional checkout step from "some other" location than the Jenkinsfile repo.

      When used in a multibranch pipeline, changes to the "other" repo are not detected by the branch indexer. A normal pipeline job using the same Jenkinsfile will correctly poll for changes to this other repo.

      Test Repo Structure

      - root-folder
         |- branches
             |- branch-a
                 |- foo.txt
                 |- Jenkinsfile
             |- branch-b
                 |- bar.txt
                 |- Jenkinsfile (same as branch-a)
         |- other-lib
             |- baz.txt
      

      Pipeline Job (correct polling)

      1. Build once, observe checkout from branch-a and other-lib as per Jenkinsfile
      2. Modify other-lib/baz.txt in SCM
      3. Observe polling log detect changes to other-lib:

      Received SCM poll call on master for PipelinePollTest on 02-Dec-2016 08:17:01
      https://192.168.0.31/svn/base/branches/personal/jamie/jenkins-bug-repro/branches/branch-a is at revision 43,233
      Received SCM poll call on master for PipelinePollTest on 02-Dec-2016 08:17:01
      https://192.168.0.31/svn/base/branches/personal/jamie/jenkins-bug-repro/other-lib is at revision 43,235
        (changed from 43,234)
      Done. Took 47 ms
      Changes found
      

      Multibranch Pipeline Job (branch indexing)

      1. Initial branch indexing detects both branches and generates subjobs / schedules them
      2. Modify other-lib/baz.txt in SCM
      3. Observe indexing log does not detect this change

      Started by timer
      Opening conection to https://192.168.0.31/svn/base/branches/personal/jamie/jenkins-bug-repro/branches/
      Checking directory /branches/personal/jamie/jenkins-bug-repro/branches@HEAD
      Checking candidate branch /branches/personal/jamie/jenkins-bug-repro/branches/branch-a@43233
      Met criteria
      No changes detected in branch-a (still at 43233)
      Checking candidate branch /branches/personal/jamie/jenkins-bug-repro/branches/branch-b@43233
      Met criteria
      No changes detected in branch-b (still at 43233)
      Finished: SUCCESS
      

      Expected Result
      For the behaviour to be consistent between these two job types - the branch indexer should be able to detect these changes considering comment on JENKINS-34737 stating this polling behaviour is subsumed into the indexing. (https://issues.jenkins-ci.org/browse/JENKINS-34737?focusedCommentId=262423&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-262423)

          [JENKINS-40182] Branch indexing does not poll its generated subitems

          Jesse Glick added a comment -

          Branch indexing pays no attention to checkout steps. It only considers the SCM source configured on the folder.

          If you wish to perform regular polling on unrelated repositories, use properties to add an SCM trigger.

          Jesse Glick added a comment - Branch indexing pays no attention to checkout steps. It only considers the SCM source configured on the folder. If you wish to perform regular polling on unrelated repositories, use properties to add an SCM trigger.

          James Femia added a comment -

          If I understand correctly you mean add the polling instruction into the Jenkinsfile using properties?

          Will look into it more tomorrow, but after a brief look, I'm struggling with the syntax for this - the snippet generator for properties / Poll SCM generates me this line (verbatim)

          properties([pipelineTriggers([<object of type hudson.triggers.SCMTrigger>])])
          

          Is there an example somewhere of what the polling snippet is supposed to look like?

          James Femia added a comment - If I understand correctly you mean add the polling instruction into the Jenkinsfile using properties ? Will look into it more tomorrow, but after a brief look, I'm struggling with the syntax for this - the snippet generator for properties / Poll SCM generates me this line (verbatim) properties([pipelineTriggers([<object of type hudson.triggers.SCMTrigger>])]) Is there an example somewhere of what the polling snippet is supposed to look like?

          Jesse Glick added a comment -

          Make sure you have updated all plugins, since there were bug fixes in snippet generation for properties. Please use the users list for help.

          Jesse Glick added a comment - Make sure you have updated all plugins, since there were bug fixes in snippet generation for properties . Please use the users list for help.

            Unassigned Unassigned
            jfemia James Femia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: