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

Specifiying multiple refspecs in git-plugin will make polling for changes make fail always

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • git-plugin

      We use the git notes functionality to add notes during build and for many other things. We have to fetch them from the repository next to the code related things, so we specified this refspec:

      +refs/heads/*:refs/remotes/origin/* +refs/notes/*:refs/notes/*

      Checkout, and fetch works as before, but as soon as we want to use the scm-polling feature, no changes will be detected.

      Viewing the SCM poll protocol will give:

      Started on Dec 1, 2015 3:02:00 PM
      Using strategy: Default
      [poll] Last Built Revision: Revision cefd54a11d3b85981409065ebb073a5e5715b36c (refs/remotes/origin/master)
      using GIT_SSH to set credentials Jenkins CI System Login for GIT registered at Administrator root account on gitlab
       > git --version # timeout=10
       > git -c core.askpass=true ls-remote -h ssh://git@****/jenkins-test.git # timeout=10
      Found 2 remote heads on ssh://git@****/jenkins-test.git
      Ignoring refs/heads/testBranch as it doesn't match configured refspecs
      Ignoring refs/heads/master as it doesn't match configured refspecs
      Done. Took 0.63 sec
      No changes
      
      

      origin/JENKINS-31393
      In the case we remove the additional refspec (using only

      +refs/heads/*:refs/remotes/origin/*

      ) and use only one, everything works as expected:

      Started on Dec 1, 2015 2:51:00 PM
      Using strategy: Default
      [poll] Last Built Revision: Revision cefd54a11d3b85981409065ebb073a5e5715b36c (refs/remotes/origin/master)
      using GIT_SSH to set credentials Jenkins CI System Login for GIT registered at Administrator root account on gitlab
       > git --version # timeout=10
       > git -c core.askpass=true ls-remote -h ssh://git@***/jenkins-test.git # timeout=10
      Found 2 remote heads on ssh://git@****/jenkins-test.git
      [poll] Latest remote head revision on refs/heads/master is: cefd54a11d3b85981409065ebb073a5e5715b36c - already built by 51
      Done. Took 0.56 sec
      No changes
      

      There seems to be a problem with refspec parsing / matching if there are multiple.

      We are using Jenkins v. 1.638 and git-plugin 2.4.0

            Unassigned Unassigned
            boldie Sven S.
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: