Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-45533

Bitbucket webhook push notification are ignored on trait implementation

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      We have job of kind multibranch pipeline configured for our organisation Bitbucket Cloud account.
      We have enable webhook Bitbucket Could side in each repository settings (we don't use plugin webhook management due our build user doesn't have admin access).
      Just for information, we only manage private repository.

      When we use the non Trait version of this plugin a commit triggers a build to the respective multibranch pipeline job.

      Now with the beta version (that avoid duplicated jobs for both branch and PR), a commit does not trigger anymore a "branch event" build (as reported in the Trait PR.

      As workaround we had enable the "Scan Multibranch Pipeline Triggers" every XX minutes option to trigger new builds.

      Steps to reproduce:

      1. Create a private bitbucket could
      2. In the repository settings add a new Webhook (like described in the plugin help section)
        Title: Jenkins
        URL: https://acme.com/jenkins/bitbucket-scmsource-hook/notify
        Actions:
      • Repository PUSH
      • Pull Request: CREATED, UPDATED
      1. Commit a simple Jenkinsfile
        node {
        	stage ('Checkout') {
        		checkout scm
        	}
        }
        
      2. Create a multibranch pipeline job
      3. Setup the job with the following Traits:
      • Exclude branch that are also PR
      • Checkout Over SSH
      • Override Hook Management (not neessary)
      • Clean after checkout

      After that perform more commits

        Attachments

          Issue Links

            Activity

            Hide
            stephenconnolly Stephen Connolly added a comment -

            As a native english speaker, I am having a hard time parsing the description. Do you think you could take some time to clarify in more details (ideally with steps to reproduce)

            Show
            stephenconnolly Stephen Connolly added a comment - As a native english speaker, I am having a hard time parsing the description. Do you think you could take some time to clarify in more details (ideally with steps to reproduce)
            Hide
            nfalco Nikolas Falco added a comment - - edited

            The description was updated with more details

            With a debug session and I found an issue in the inner class

            SCMHeadEvent#isServerUrlMatch())
            

            The branch

            if (getPayload() instanceof BitbucketCloudPushEvent) {
                return false
            }
            

            always returns false in case of repo:push event and block the propagation of the webhook

            Show
            nfalco Nikolas Falco added a comment - - edited The description was updated with more details With a debug session and I found an issue in the inner class SCMHeadEvent#isServerUrlMatch()) The branch if (getPayload() instanceof BitbucketCloudPushEvent) { return false } always returns false in case of repo:push event and block the propagation of the webhook
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Aha! Good digging. I think it makes sense now.

            Show
            stephenconnolly Stephen Connolly added a comment - Aha! Good digging. I think it makes sense now.
            Hide
            stephenconnolly Stephen Connolly added a comment -

            2.2.0

            Show
            stephenconnolly Stephen Connolly added a comment - 2.2.0

              People

              • Assignee:
                stephenconnolly Stephen Connolly
                Reporter:
                nfalco Nikolas Falco
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: