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

"Bitbucket Server" SCM does not support "Poll SCM" trigger in case of triggering polling by a hook

XMLWordPrintable

      Problem description

      Bitbucket Server SCM (com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCM) does not support Poll SCM trigger (hudson.triggers.SCMTrigger) is case of triggering polling by a hook (see the details in https://plugins.jenkins.io/git/#plugin-content-push-notification-from-repository).

      Impact

      Because of JENKINS-62057, Bitbucket webhook trigger does not work in some cases. In such cases Poll SCM is the only trigger supporting the SCM's field Polling ignores commits in certain paths (PathRestriction). Therefore I set the priority to the same value - critical.

      Steps to reproduce

      1. Create a git repository in Bitbucket Server, e.g.:
        https://mybitbucket.example/users/myuser/repos/myrepo/browse
        ssh://git@mybitbucket.example:7999/~myuser/myrepo.git
      2. Create a Freestyle Job in Jenkins, e.g. "myfolder/myjob":
        1. In the Source Code Management section select Bitbucket Server and configure it.
        2. In the Build Triggers section select Poll SCM and:
          1. Leave the Schedule field empty.
          2. Ensure that the Ignore post-commit hooks checkbox is switched off (it is by default).
        3. Add some step.
        4. Click Save or Apply.
      3. Get your access token from your Jenkins administrator (see https://plugins.jenkins.io/git/#plugin-content-push-notification-from-repository).
      4. Create a Webhook in the git repository in Bitbucket.
        1. Set some Name.
        2. Set URL to e.g.:
          https://myjenkins.example/git/notifyCommit?url=ssh://git@mybitbucket.example:7999/~myuser/myrepo.git&token=YOUR_ACCESS_TOKEN
          
        3. Click Test connection.
        4. Click View details.

      Actual result

      No git jobs using repository: ssh://git@mybitbucket.example:7999/~myuser/myrepo.git.

      Response details

      HTTP status: 200

      Headers

      Server: Jetty(10.0.15)
      X-Content-Type-Options: nosniff
      Connection: keep-alive
      Content-Length: 198
      Date: Tue, 31 Oct 2023 15:53:53 GMT
      Via: 1.1 localhost (Apache-HttpClient/4.5.13 (cache))
      Content-Type: text/plain; charset=ISO-8859-1
      

      Body

      No git jobs using repository: ssh://git@mybitbucket.example:7999/~myuser/myrepo.git and branches: 
      No Git consumers using SCM API plugin for: ssh://git@mybitbucket.example:7999/~myuser/myrepo.git
      

      Expected result

      Scheduled polling of myfolder > myjob.

      Response details

      HTTP status: 200

      Headers

      Triggered: https://myjenkins.example/job/myfolder/job/myjob/
      Server: Jetty(10.0.15)
      X-Content-Type-Options: nosniff
      Connection: keep-alive
      Content-Length: 165
      Date: Tue, 31 Oct 2023 15:56:25 GMT
      Via: 1.1 localhost (Apache-HttpClient/4.5.13 (cache))
      Content-Type: text/plain; charset=ISO-8859-1
      

      Body

      Scheduled polling of myfolder � myjob
      No Git consumers using SCM API plugin for: ssh://git@mybitbucket.example:7999/~myuser/myrepo.git
      

            Unassigned Unassigned
            andreymz Andrey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: