Error retrieving tag timestamp from webhook event since plugin version 935.0.0

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • None
    • Environment:
      Jenkins: 2.492.2
      Bitbucket-branch-source-plugin: 935.1.3
      Bitbucket Server: 8.19.16
    • 936.1.0

      After upgrading to a later version of the Bitbucket Branch Source plugin (which includes the changes from https://github.com/jenkinsci/bitbucket-branch-source-plugin/commit/156beebf299050e191b13837d89f94733eb31339), we are encountering the following error in the server logs:

      "Fail to retrieve the timestamp for tag event <tag>".

      This issue occurs because the webhook event sent by Bitbucket (version 8.19) follows the following format:

      {  
        "eventKey":"repo:refs_changed",
        "date":"2025-03-10T09:47:32+1000",
        "actor":{ ...  },
        "repository":{  ...  },
        "changes":[  
          {  
            "ref":{  
              "id":"refs/tags/0.1.0",
              "displayId":"0.1.0",
              "type":"TAG"
            },
            "refId":"refs/tags/0.1.0",
            "fromHash":"0000000000000000000000000000000000000000",
            "toHash":"b82dd854c413d8e09aaf68c3c286f11ec6780be6",
            "type":"ADD"
          }
        ]
      } 

      In the current implementation of ServerPushEvent, the call to client.resolveCommit(change.getFromHash()) is making a request to Bitbucket's commits endpoint using "0000000000000000000000000000000000000000" as the parameter. This always results in a 404 error and a SERVER-log in Jenkins. 

      Instead, if the toHash value is used, Bitbucket returns the commit the tag points to, which works correctly. At least for Bitbucket Server 8.19.

            Assignee:
            Nikolas Falco
            Reporter:
            Rickard Andersson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: