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

notifyCommit doesn't spawn a build unless a job on another branch is already running that build




      I may not be able to provide a lot of information, but here's what I know.

      I have a build job that is designed to build master or pull request branches, depending on a custom branch parameter. I also clone the job for each current release branch we are working on.  The job specifies a "Pipeline script from SCM" and specifies the git repo we are using, and the branch (master or release).

      We use BitBucket, and the "Bitbucket Server Webhook to Jenkins", along with the "Pull Request Notifier" in BitBucket.  When we create pull requests, the PRN works fine and causes Jenkins to run the job on the pull request branch.

      When we merge a PR to master, or a release branch, most of the time it does not spawn a build of the master or release branch. Today I may have discovered the circumstances that result in it spawning a build on a merge.

      If no build is currently running, the merge to master does not spawn a build.

      If a build of the master branch is currently running, the merge to master does not spawn a build.

      However, if there is currently a build running of a pull request branch, the merge to master DOES spawn a build (makes it pending) of the master branch.

      I've tested this several times today, although only with a single pull request branch. I would find it hard to believe it matters which pull request branch it is.

      In our testing, we haven't really been merging PRs to master each time, we simply recorded the "notifyCommit" URL and we've been manually running it with "curl".

      So, for instance, we would run something like the following:


      curl -fsSL -D - -g 'http://...:17723/jenkins/git/notifyCommit?url=ssh://git@...:7999/st_usl/oce_usl.git&branches=master&sha1=eb4326eb8c48ec4793abe5330e9dce199d6a5dc0'

      I've reused this exact command line for my tests. If a build is not running, or a build of master is running, I get the following output:



      No git jobs using repository: ssh://...:7999/st_usl/oce_usl.git and branches: master
      No Git consumers using SCM API plugin for: ssh://git@...:7999/st_usl/oce_usl.git


      If, however, there is a current build with job on a pull request branch, it gives me this (where "foo" is my job name):


      Scheduled foo
      No Git consumers using SCM API plugin for: ssh://git@...:7999/st_usl/oce_usl.git

      And this results in a job being started.

      Note that we're using a somewhat older version of Jenkins.  We've decided to upgrade to
      2.56.2, but we have no certainty this problem will go away in that version.
      I'm not the admin for the server, but if more information is needed, the admin can either comment on this, or I can get required information from him.



          dkarr David Karr created issue -
          markewaite Mark Waite made changes -
          Field Original Value New Value
          Assignee Boguslaw Klimas [ klimas7 ]
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]
          markewaite Mark Waite made changes -
          Status Resolved [ 5 ] Closed [ 6 ]


            Unassigned Unassigned
            dkarr David Karr
            0 Vote for this issue
            2 Start watching this issue