Webhook handling for Tags broken (JENKINS-57516)
See original GitHub issueYour checklist for this issue
-
Jenkins version - 2.150.2
-
Plugin version - 2.4.4
-
Bitbucket cloud - NO
-
Bitbucket server and version - v5.11.3
Description
Pushes to BitBucket for Tags are not handled by the plugin correctly. The following Error is printed when the webhook is configured:
Jun 12, 2019 7:36:50 PM com.cloudbees.jenkins.plugins.bitbucket.hooks.NativeServerPushHookProcessor$HeadEvent addBranches
INFO: Received event for unknown ref type TAG of ref v3.5.1
It seems the plugin is not expecting any tags, however tag discovery can be configured.
When I manually scan the repo in the multibranch job with tag filtering enabled, I get proper discovery, however autodiscovery on webhook would be nice.
This seems to be related with https://issues.jenkins-ci.org/browse/JENKINS-57516
Example content for tags can be found here: https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html
{
"eventKey": "repo:refs_changed",
"date": "2019-03-07T11:38:15+0000",
"actor": {
"name": "richard.lees",
"emailAddress": "removed@removed.co.uk",
"id": 1260,
"displayName": "Richard Lees",
"active": true,
"slug": "richard.lees",
"type": "NORMAL"
},
"repository": {
"slug": "dkr-jenkins-slave-hybris65",
"id": 260,
"name": "dkr-jenkins-slave-hybris65",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "PKR",
"id": 231,
"name": "Packer",
"description": "Packer scripts for generating both AMI and Docker images.",
"public": false,
"type": "NORMAL"
},
"public": false
},
"changes": [
{
"ref": {
"id": "refs/tags/test1",
"displayId": "test1",
"type": "TAG"
},
"refId": "refs/tags/test1",
"fromHash": "0000000000000000000000000000000000000000",
"toHash": "76e67f1b12f5232c76eb531099782f5058d2986e",
"type": "ADD"
}
]
}
It seems we hit the filter: https://github.com/jenkinsci/bitbucket-branch-source-plugin/blob/c81bc520c0f8057e82f6459c1132e97c6e2e6ca7/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/NativeServerPushHookProcessor.java#L146-L149
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:14 (4 by maintainers)
Top GitHub Comments
Which has been out since 2.5.0: https://github.com/jenkinsci/bitbucket-branch-source-plugin/commit/237950221788d47785680ef5e2f2da4402299d25
@casz Tags are now successfully discovered. Looks like its working now properly and this issue can be closed as its solved by https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/230 Thanks!