-
Bug
-
Resolution: Fixed
-
Minor
-
Jenkins 2.235.1
Pipeline: Multibranch 2.21
Bitbucket Branch Source Plugin 2.8.0
Bitbucket Server Integration 2.0.0
-
-
2.1.1
I set up two multibranch projects in the same Jenkins instance. Both of them refer to the same repository in Bitbucket Server, but one of them is using Bitbucket Branch Source Plugin and the other is using Bitbucket Server Integration. Each of them has its own webhook in Bitbucket Server. The "Bitbucket Server trigger scan after push" option is checked only in the multibranch project that uses Bitbucket Server Integration.
Now when I push commits to the repository, the webhooks correctly trigger a build in each multibranch project. However, the build using Bitbucket Branch Source Plugin fails: the multibranch project somehow believes that the branch has been deleted, so it does not clone the repository at all. If I click "Scan Multibranch Pipeline Now", then Jenkins realizes that the branch exists, and immediately builds it; but the next push will again mark the branch as deleted.
If I disable the webhook that has been set by Bitbucket Server Integration, and push again, then Jenkins understands that the branch exists, and further pushes do not change that. Therefore, it seems that the webhook handler in Bitbucket Server Integration is messing up the branch in the multibranch project that is using Bitbucket Branch Source Plugin.
- relates to
-
JENKINS-63815 multi-branch pipeline not able to receive bitbucket push event
-
- Closed
-
Oh no! The Bitbucket Server Integration webhook handler was marking a branch as deleted even when I pushed commits to an entirely different (not a fork) repository in a different Bitbucket Server project, and the name of the branch (e.g. "master") matched. This was evident from the "Multibranch Pipeline Events" log in Jenkins.
There are some projects that I cannot migrate from Bitbucket Branch Source Plugin to Bitbucket Server Integration before
JENKINS-63033is implemented, and I cannot require each repository to use distinct branch names, so I have now reverted all projects back to Bitbucket Branch Source Plugin, deleted the webhooks, and revoked the access token to prevent users from adding any more webhooks via the plugin.