-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: bitbucket-branch-source-plugin
-
None
,,
Bitbucket tag deletion webhook no longer removes tag after 937.3.2
Description
After upgrading Bitbucket Branch Source to 937.3.2 or newer, deleting a tag in Bitbucket no longer causes the corresponding tag to be removed from a Jenkins Multibranch Pipeline / Organization Folder.
The Bitbucket repo:refs_changed webhook is received and recognized by Jenkins, but the deleted tag remains in Jenkins until a manual repository scan is performed.
This also causes re-creating the same tag to not trigger correctly, because Jenkins still considers the old tag to exist.
The behavior works correctly with an older Bitbucket Branch Source version.
Steps to reproduce
- Configure a Bitbucket repository in a Jenkins Organization Folder / Multibranch Pipeline with tag discovery enabled.
- Create and push a tag:
Â
{{git tag 3.0.8
git push origin 3.0.8}}
The tag is discovered correctly by Jenkins.
- Delete the tag from Bitbucket UI.
Bitbucket sends a repo:refs_changed event with:
Â
{{
{ "ref":
,
"type": "DELETE"
}}}
Jenkins receives the webhook and logs:
Â
Hook processor com.cloudbees.jenkins.plugins.bitbucket.impl.webhook.server.ServerPushWebhookProcessor found.
However, the 3.0.8 tag remains in Jenkins.
- Re-create 3.0.8 pointing to a new commit.
The new tag is not processed as expected because Jenkins still has the previous 3.0.8 SCM head.
- Run Scan Multibranch Pipeline Now / repository indexing after deleting the tag.
The deleted tag is then correctly removed.
If 3.0.8 is subsequently recreated, the new tag is discovered correctly.
Expected behavior
A TAG DELETE webhook should cause Jenkins to remove/reconcile the corresponding tag SCM head without requiring a manual repository scan.
Afterward, re-creating the same tag should be processed normally.
Actual behavior
The TAG DELETE webhook reaches Jenkins, but the tag remains until a manual scan.
This leaves stale tag state in Jenkins and prevents delete → re-create workflows from working correctly.
Regression
The same configuration and Bitbucket webhook work correctly with an older Bitbucket Branch Source version.
The issue appears with 937.3.2 and newer.
A possible related change is:
JENKINS-76468 / PR #1206 — "Skip retrieving tags on non tag related events"
Commit:
509b9b459e6d7ac8c7778c2583b29e5341547cc6
The selective tag retrieval introduced there may be related to the behavior, particularly for deleted tags that can no longer be retrieved from Bitbucket after the DELETE event.
Environment
- Bitbucket Branch Source: 937.3.2+
- Bitbucket: Server/Data Center
- Tag discovery: Enabled
Additional information
The Bitbucket webhook itself appears to be working correctly. Jenkins receives the repo:refs_changed event and selects ServerPushWebhookProcessor.
A manual scan immediately reconciles the deleted tag, which suggests the issue is specific to webhook/event-based tag reconciliation rather than tag discovery itself.
- links to