question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webhook handling for Tags broken (JENKINS-57516)

See original GitHub issue

Your 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:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

0reactions
szEvEzcommented, Feb 14, 2020

@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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multibranch pipeline does not handle correctly webhook of ...
When I create a tag on Bitbucket Cloud the webhook notify Jenkins for a new tag. But the jenkins plugin does not handle...
Read more >
Github Webhook not working after upgrade Jenkins and plugins
When github sends a webhook to trigger a build in Jenkins, the Job does not start. I've already downgraded Jenkins and github plugin...
Read more >
Outbound WebHook for build events - Jenkins Plugins
Create a tag on GitHub: outbound-webhook-plugin-<version> . Create file ~/.jenkins-ci.org with the following content: userName=username password ...
Read more >
Triggering builds with webhooks behind a secure firewall
In this post I wanted to show how you can run Jenkins behind a firewall (which could be a corporate firewall, a NAT'ed...
Read more >
Generic Webhook Trigger - Jenkins Plugins
This is a Jenkins plugin that can: ... Then you can have a variable, resolved from post content, named ref of type JSONPath...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found