-
Bug
-
Resolution: Not A Defect
-
Major
-
Jenkins 2.19.3 LTS, pipeline multibranch plugin 2.9.2
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)
- 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:
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)
- 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
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)
- relates to
-
JENKINS-32018 Multibranch workflow project tracking multiple repositories
-
- Open
-
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.