We see duplicate builds running on Jenkins multi-industry pipeline projects. Builds are usually started using push notifications from Bitbucket using this plugin: https://marketplace.atlassian.com/plugins/com.nerdwin15.stash-stash-webhook-jenkins/server/overview
However, for some reason, we now see "double" assemblies. If you look at the two assemblies that start, one starts with a "commit notification" and the other with "Branch Indexing".
What is the reason for indexing a branch and why does it start the assembly? We do not add or remove branches, this is just a regular commit / push.
To make it more complicated, this does not happen all the time. At some point, I thought that this only happens after the mergers, but it is not. In addition, one way to stop this is to delete the build history for the job (which is obviously not ideal).
We set the properties for the job from the pipeline script, but only to undo the old assemblies:
properties([buildDiscarder(logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '20'))])
Another source of confusion, apparently, is that you need to enable polling (without an interval) so that push notifications work for the Git plugin. The documentation for the Git plugin indicates that this is necessary and, indeed, it seems that this is for “normal” assembly pipelines, but apparently not required for assemblies with multiple branches. It is right? From the Jenkins Git Plugin Wiki:
This will scan all jobs that:
> SCM. . URL. . , , . , , , , .
Bitbucket 4.8.4 Jenkins 2.30 ( ).