bitbucket-push-and-pull-request-plugin
bitbucket-push-and-pull-request-plugin copied to clipboard
Multibranch with shared library, SCM doesn't match remote repo
Have a multibranch pipeline project which make use of a shared pipeline library.
Build trigger failed as
// TODO: is it needed? There is only a remote, the HTML one, that is used the do // the // match boolean isRemoteSet = false; for (URIish remote : remotes) { if (match(scmTrigger, remote)) { isRemoteSet = true; break; } }
(BitBucketPPRJobProbe.java)
does not match.
It compares "Trying to match ssh://jenkins-pipeline.git<-->ssh://my-code-repo.git" and so stays false.
Had a similar problem in gitParameter plugin where I have to set a "useRepository" filter to ensure proper selection from my-code-repo.git instead of jenkins-pipeline.git.
We also have two "Git Build Data" icons in our job sidebar - one for my-code-repo and one for jenkins-pipeline.
So may we need a filter here too? It just logs "Considering to use trigger hudson.plugins.git.GitSCM" once when
item.ifPresent(i -> i.getSCMs().stream().forEach(scmTrigger -> { logger.log(Level.FINE, "Considering to use trigger {0}", scmTrigger.toString());
May another scm source has to be added or Optional<SCMTriggerItem> item = Optional.ofNullable(SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(job));
already filters out the needed one?