Multibranch is designed to remove the need for individual jobs to poll.
When a scan is performed, we get - in one set of requests - all the head revisions and then trigger builds for all branches with changes. This reduces the impact of many jobs polling. Additionally events are consolidated on a single path meaning that jobs get triggered without needing a scan at all and with only verification of the event details.
The down-side (currently) is that we do not have a good solution for where you want to check out multiple sources. This in part reflects some of the difficulties involved. For one, there is the question of how to align branches:
* do you always check out the "master" branch of the second repository?
* do you always check out the same named branch?
* do you check out the same named branch and fall back to the master branch if there is no matching one?
* what about more complex flows like with git flow?
* it is highly unlikely that PRs against different repos will get the same number, how do you determine the branch to use for PRs
And that is just the start of the problem.
Right now my recommendation is to use a Jenkinsfile in the second repo that just triggers the build in the first repo. That way the commit against the second repo will trigger a build of your main job that checks out the primary and secondary repos.
--
Sent from my phone