-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Jenkins ver. 2.107.2
bitbucket-branch-source-plugin 2.2.11
-
-
2.2.13
When I create a tag on Bitbucket Cloud the webhook notify Jenkins for a new tag. But the jenkins plugin does not handle it has a SCM event of kind tag but as branch created event.
The PushHookProcessor should be changed (line 165) to check of which kind of event is the notification.
if (change.isClosed()) { result.put(new BranchSCMHead(change.getOld().getName(), type), null); } else { // created is true Reference newChange = change.getNew(); SCMHead head = null; if ("tag".equals(newChange.getType())) { head = new BitbucketTagSCMHead(newChange.getName(), newChange.getDate().getTime(), type); } else { head = new BranchSCMHead(newChange.getName(), type); } ... }
It is also needed add date to the com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketPushEvent.Reference.
I also suggest to configure the ObjectMapper in payload parser (JsonParser) to use the ISO8601DateFormat that comes with jackson instead the custom.
Use a specific deserialiser for BitbucketCloudRepository.updatedOn where BB sends an invalid ISO8601 date format (6 decimal for milliseconds field instead 3 that cause date parse error)
- blocks
-
JENKINS-47254 Support for building tags for Bitbucket Server/Cloud
-
- Closed
-
- is related to
-
JENKINS-57516 Bitbucket branch source does not support tag notification
-
- Resolved
-
- links to
Hi nfalco,
I didn't see you were working on this issue too ^^.
FYI, I fixed the issue as you suggested here https://github.com/arnaud-deprez/bitbucket-branch-source-plugin/blob/JENKINS-51063/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/hooks/PushHookProcessor.java#L165-L168.
I tested it and it works, thanks!
It however does not use yet:
because it does not exist in the bitbucket post webhook plugin (bitbucket server) as far as I see.
Should I submit it as is in a PR or do you prefer to have the clean fix with this date read from the hook ?