-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: bitbucket-branch-source-plugin
-
None
When a commit is pushed to a branch that has an open pull request, Bitbucket sends two separate webhook events: a repository push event and a pull request update event. The push event's own pull-request lookup ("Looking up <repo> for pull requests") is returning zero results, even though an open pull request does exist for that exact branch. Because of this, the exclude-trait logic concludes the branch is not filed as a PR and schedules a branch build. Moments later, the separate PR event is processed independently and correctly finds and builds the PR. The result is two builds running for the same commit.
Manually triggering "Scan Multibranch Pipeline Now" correctly detects the pull request and discards the branch, confirming the exclude-trait logic itself is sound. The bug is specific to the webhook event push processing path, not the discovery strategy configuration.
Steps to reproduce:
- Configure a Bitbucket Cloud multibranch source with branch discovery set to exclude branches also filed as pull requests, and PR discovery enabled.
- Open a pull request from an existing branch.
- Push a new commit to that branch.
- Observe two webhook deliveries: a push event and a PR update event, arriving seconds apart.
Expected behavior: The push event correctly detects the existing pull request and discards the branch, matching what a manual scan does. Only the PR build runs.
Actual behavior: The push event's pull-request lookup returns 0 results, the branch build is scheduled anyway, and the PR build also runs:Â two builds for one commit.
Workaround: Downgrading to 937.3.1 resolves the issue.
Â