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

          James Femia created issue -
          James Femia made changes -
          Description Original: 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*
          {noformat}
          - root-folder
             |- branches
                 |- branch-a
                     |- foo.txt
                     |- Jenkinsfile
                 |- branch-b
                     |- bar.txt
                     |- Jenkinsfile (same as branch-a)
             |- other-lib
                 |- baz.txt
          {noformat}

          *Pipeline Job* (correct polling)
           - Poll SCM: Enabled {{(H/10 * * * *)}}
           - Pipeline script from SCM: {{https://url/to/branches/branch-a}}
           - Local Module Directory: {{empty}}

          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}}:
          {noformat}
          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
          {noformat}

          *Multibranch Pipeline Job* (branch indexing)
           - Project Base: {{https://url/to/branches}}
           - Include Branches: {{*}}
           - Periodically if not otherwise run: {{1 minute}}

          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
          {noformat}
          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
          {noformat}

          *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)
          New: 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*
          {noformat}
          - root-folder
             |- branches
                 |- branch-a
                     |- foo.txt
                     |- Jenkinsfile
                 |- branch-b
                     |- bar.txt
                     |- Jenkinsfile (same as branch-a)
             |- other-lib
                 |- baz.txt
          {noformat}

          *Pipeline Job* (correct polling)
           - Poll SCM: Enabled {{(H/10 * * * *)}}
           - Pipeline script from SCM: {{https://url/to/branches/branch-a}}
           - Local Module Directory: {{empty}}

          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}}:
          {noformat}
          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
          {noformat}

          *Multibranch Pipeline Job* (branch indexing)
           - Project Base: {{https://url/to/branches}}
           - Include Branches: {{*}}
           - Periodically if not otherwise run: {{1 minute}}

          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*
          {noformat}
          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
          {noformat}

          *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)
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-32018 [ JENKINS-32018 ]
          Jesse Glick made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: