-
Bug
-
Resolution: Unresolved
-
Major
-
JDK 8u112, Linux 64bit, Jenkins 2.3.2, BitBucket-build-status-notifier-plugin 1.3.1
I created a new build with multiple Git repositories ( Not Multi-SCM ).
I set the advanced name setting for each repository.
I am able to build from first Git repo, and upon success push to second Git repo using 'Git Publisher'. I am getting error from the notifier plugin during the build process. It would be helpful to have an option in the plugin to choose which repository to notify.
Stack trace output:
Bitbucket notify on start failed: None or multiple repos
java.lang.Exception: None or multiple repos
at org.jenkinsci.plugins.bitbucket.scm.GitScmAdapter.getCommitRepoMap(GitScmAdapter.java:53)
at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusHelper.createBuildStatusResources(BitbucketBuildStatusHelper.java:87)
at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusHelper.createBuildStatusResources(BitbucketBuildStatusHelper.java:144)
at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusHelper.notifyBuildStatus(BitbucketBuildStatusHelper.java:231)
at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusHelper.notifyBuildStatus(BitbucketBuildStatusHelper.java:224)
at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier.prebuild(BitbucketBuildStatusNotifier.java:109)
at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:834)
at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:829)
at hudson.model.Build$BuildExecution.doRun(Build.java:144)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
- is related to
-
JENKINS-54260 Fails when notifying for merged PR build
-
- Open
-
The solution involves changes to the BitbucketBuildStatusHelper and to the <*>ScmAdapter classes. The former must add a new parameter (e.g. repoToNotify) with its corresponding DataBound setter to capture the user input. The SCM adapters already receive the correct scm object but only get one build action from the build object. When there are more than one repo being accessed in a build, there will be multiple actions so we need to get all the actions and then check which of them corresponds to the target repository that will be notified. This will ensure we get the correct commit hash to be notified (instead of just the first one that is in the build's scm object list). It's tempting to notify multiple repositories at once, but I woujld vote to start with single repo notification at first.