In Bitbucket Server, there are scenario where Bitbucket sends a payload with empty changes array.
Rebase a target branch to a source branch while a PR is open
If a PR is open on a Bitbucket repository, and a developer rebase the target branch with the source branch of the PR and push to the target.
git checkout main git checkout -B source-1 echo "test" >> source-1.md git add . && git commit -m "source-1: $(date)" && git push --set-upstream origin source-1 git push --set-upstream origin source-1
# Open a PR for from the source branch `source-1` to the target branch `main`
git checkout main git rebase -i source-1 git push -f
Bitbucket webhook sends 2 repo:refs_changed events:
* One with an empty changes array
* Another one with the changes array properly populated
That first event seems un-necessary and does not seem to contain any information that help understand what happened.
As mentioned in the scenario, this only happens if a pull request has been open from the source branch to the target branch. That PR is automatically merged because the diff is empty and I have a feeling that this is why this event is sent...
Auto-Sync of Fork when a branch cannot be synchronized
This is another scenario that produces a repo:refs_changes event with empty changes.
When Automatic Fork Syncing is enabled on a fork repository, If a branch on the fork cannot be synchronized with the remote, the attempt from Bitbucket to automatically synchronize it generates a repo:refs_changed with empty changes.
This scenario is odd because no ref has actually changed on the fork...
NOTE: Those have been detected while trying to address an issue reported in Jenkins integrations: https://issues.jenkins.io/browse/JENKINS-55927.
Could those behaviors be bugs in Bitbucket Server webhooks ?
Thanks !
Hello team. Any updates about this ?
Time to up your Loom game! The new Loom Essentials Certification is here! Show off your skills, learn pro tips, and get officially recognized. Perfect for taking your video messaging to the next level.
Learn moreOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.