• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • git-plugin
    • Jenkins 1.620, Git Plugin 2.4.0

      I have a simple Jenkins job called "myjob":

      • Repository URL: git@mygitserver.com:rep
      • Branches to build: master
      • Build Triggers > Poll SCM is enabled

      I execute
      curl http://myjenkinsserver/jenkins/git/notifyCommit?url=git@mygitserver.com:rep&branches=mybranch
      and I get "Scheduled polling of myjob" which is WRONG, because myjob is tracking only the "master" branch (and not mybranch).

      I have hundreds of jobs and I don't want to start Git polling for every new commit.

          [JENKINS-29574] notifyCommit branch parameter is ignored

          Mark Waite added a comment - - edited

          I tested with Jenkins 1.609.1, git plugin 2.4.0 and git client plugin 1.18.0 and was unable to duplicate the problem. Can you provide more details of the job configuration which is showing the problem?

          The steps I took to try to verify the polling behavior included:

          1. Non-existent remote and workspace branch - Execute a curl command for a non-existent branch, confirm only 1 parameterized job polled (branch to build is the parameter, a little surprising, since its default value does not match the name of the non-existent branch)
            mwaite $ # Testing JENKINS-29574 from the shell
            mwaite $ curl -s http://localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=no-such-branch-exists
            Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules
            mwaite $ # Done testing JENKINS-29574 from the shell
            
          2. Non-existent remote branch, exists in some workspaces - Execute a curl command for a branch which does not exist on the remote, but exists in some of the workspaces because it was only recently deleted and those jobs are not configured to prune stale remote-tracking branches, confirmed expected jobs polled (branch=master-JGIt-push is a branch which existed on the remote repository until a few days ago and was deleted. It does exist in those jobs which are not using "prune stale remote-tracking branches"). This case correctly skipped starting a poll on other jobs and only polled on jobs which would match that name (as far as I could tell)
            mwaite $ # Testing JENKINS-29574 from the shell
            mwaite $ curl -s http://localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=master-JGit-push
            Scheduled polling of git-client-fast-my-multi
            Scheduled polling of git-client-plugin-my-coverage
            Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules
            mwaite $ # Done testing JENKINS-29574 from the shell
            
          3. Existing remote branch which is not built by any job - Execute a curl command for an existing branch, confirm expected jobs polled (branch=1.4.x is a branch which exists on the remote repository but is not monitored by any of my jobs. This case correctly skipped starting a poll on other jobs and only polled on the one parameterized job (see case 1 above)
            mwaite $ # Testing JENKINS-29574 from the shell
            mwaite $ curl -s http://localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=1.4.x
            Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules
            mwaite $ # Done testing JENKINS-29574 from the shell
            
          4. Existing remote branch which is built by many jobs - Execute a curl command for an existing branch, confirm expected jobs polled (branch=master is a branch which exists on the remote repository but is monitored by many jobs. This case correctly started a poll on those jobs and only on the one parameterized job (see case 1 above)
            mwaite $ # Testing JENKINS-29574 from the shell
            mwaite $ curl -s http://localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=master
            Scheduled polling of git-client-fast-multi
            Scheduled polling of git-client-fast-my-multi
            Scheduled polling of git-client-merge-bitbucket-master
            Scheduled polling of git-client-merge-upstream-jdk8
            Scheduled polling of git-client-merge-upstream-latest
            Scheduled polling of git-client-merge-upstream-long-term-support
            Scheduled polling of git-client-merge-upstream-master
            Scheduled polling of git-client-multi-master
            Scheduled polling of git-client-plugin-master-coverage
            Scheduled polling of git-client-plugin-my-coverage
            Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules
            mwaite $ # Done testing JENKINS-29574 from the shell
            

          Could you try your same case(s) with the Jenkins long term support version (1.609.1) like I did, to see if there is a difference in behavior between the long term support version and the current development version?

          Mark Waite added a comment - - edited I tested with Jenkins 1.609.1, git plugin 2.4.0 and git client plugin 1.18.0 and was unable to duplicate the problem. Can you provide more details of the job configuration which is showing the problem? The steps I took to try to verify the polling behavior included: Non-existent remote and workspace branch - Execute a curl command for a non-existent branch, confirm only 1 parameterized job polled (branch to build is the parameter, a little surprising, since its default value does not match the name of the non-existent branch) mwaite $ # Testing JENKINS-29574 from the shell mwaite $ curl -s http: //localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=no-such-branch-exists Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules mwaite $ # Done testing JENKINS-29574 from the shell Non-existent remote branch, exists in some workspaces - Execute a curl command for a branch which does not exist on the remote, but exists in some of the workspaces because it was only recently deleted and those jobs are not configured to prune stale remote-tracking branches, confirmed expected jobs polled (branch=master-JGIt-push is a branch which existed on the remote repository until a few days ago and was deleted. It does exist in those jobs which are not using "prune stale remote-tracking branches"). This case correctly skipped starting a poll on other jobs and only polled on jobs which would match that name (as far as I could tell) mwaite $ # Testing JENKINS-29574 from the shell mwaite $ curl -s http: //localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=master-JGit-push Scheduled polling of git-client-fast-my-multi Scheduled polling of git-client-plugin-my-coverage Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules mwaite $ # Done testing JENKINS-29574 from the shell Existing remote branch which is not built by any job - Execute a curl command for an existing branch, confirm expected jobs polled (branch=1.4.x is a branch which exists on the remote repository but is not monitored by any of my jobs. This case correctly skipped starting a poll on other jobs and only polled on the one parameterized job (see case 1 above) mwaite $ # Testing JENKINS-29574 from the shell mwaite $ curl -s http: //localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=1.4.x Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules mwaite $ # Done testing JENKINS-29574 from the shell Existing remote branch which is built by many jobs - Execute a curl command for an existing branch, confirm expected jobs polled (branch=master is a branch which exists on the remote repository but is monitored by many jobs. This case correctly started a poll on those jobs and only on the one parameterized job (see case 1 above) mwaite $ # Testing JENKINS-29574 from the shell mwaite $ curl -s http: //localhost:8080/git/notifyCommit?url=git://github.com/jenkinsci/git-client-plugin.git\&branches=master Scheduled polling of git-client-fast-multi Scheduled polling of git-client-fast-my-multi Scheduled polling of git-client-merge-bitbucket-master Scheduled polling of git-client-merge-upstream-jdk8 Scheduled polling of git-client-merge-upstream-latest Scheduled polling of git-client-merge-upstream- long -term-support Scheduled polling of git-client-merge-upstream-master Scheduled polling of git-client-multi-master Scheduled polling of git-client-plugin-master-coverage Scheduled polling of git-client-plugin-my-coverage Scheduled polling of JENKINS-26660-submodule-checkout-does-not-clean-deleted-submodules mwaite $ # Done testing JENKINS-29574 from the shell Could you try your same case(s) with the Jenkins long term support version (1.609.1) like I did, to see if there is a difference in behavior between the long term support version and the current development version?

          Thx for your help. The problem is not Jenkins it is the misleading documentation (curl http://yourserver/git/notifyCommit?url=<URL of the Git repository>[&branches=branch1[,branch2]*][&sha1=<commit ID>]). If the & character is escaped it works. I think a little hint for linux users would be helpful...

          Ludwig Arnesen added a comment - Thx for your help. The problem is not Jenkins it is the misleading documentation (curl http://yourserver/git/notifyCommit?url= <URL of the Git repository>[&branches=branch1 [,branch2] *] [&sha1=<commit ID>] ). If the & character is escaped it works. I think a little hint for linux users would be helpful...

            ndeloof Nicolas De Loof
            ludwig Ludwig Arnesen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: