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

Invalid refspec in pull request. Doesn't check for changes in origin branch

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Blue ocean correctly discovers new pull requests, but it doesn't triggers a new build when a new commit is added to them.

      I'm using the pollSCM trigger:

      triggers {            
          pollSCM('H/5 * * * *')        
      }
      

      It triggers the check every 5 minutes, but it never checks for PR updates.

      Git log: (I've censored the url)

      Started on Aug 6, 2018 11:49:00 AM
      Using strategy: Specific revision
      [poll] Last Built Revision: Revision 1d41cbe536045aec37887e191923237f064af7ca (PR-36)
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials GitHub Access Token
       > git ls-remote -h https://github.com/<user>/<repo> # timeout=10
      Found 12 remote heads on https://github.com/<user>/<repo>
      Ignoring refs/heads/refactoring_to_java8 as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test-jenkins as it doesn't match any of the configured refspecs
      Ignoring refs/heads/RC as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test_charla as it doesn't match any of the configured refspecs
      Ignoring refs/heads/jenkins-test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/postsale as it doesn't match any of the configured refspecs
      Ignoring refs/heads/master as it doesn't match any of the configured refspecs
      Ignoring refs/heads/historyBookAlarm as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_geo as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_atp as it doesn't match any of the configured refspecs
      no polling baseline in /var/lib/jenkins/workspace/f-minion_PR-36-QKHUPNS3B4RPOEDZVQ7JEMAWKCLXDX5JRPMBGJJUVRFZ2MYNLSMQ@libs/jenkins-pipelines-scripts on 
      Using strategy: Specific revision
      [poll] Last Built Revision: Revision 1d41cbe536045aec37887e191923237f064af7ca (PR-36)
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials GitHub Access Token
       > git ls-remote -h https://github.com/<user>/<repo> # timeout=10
      Found 12 remote heads on https://github.com/<user>/<repo>
      Ignoring refs/heads/refactoring_to_java8 as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test-jenkins as it doesn't match any of the configured refspecs
      Ignoring refs/heads/RC as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test_charla as it doesn't match any of the configured refspecs
      Ignoring refs/heads/jenkins-test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/postsale as it doesn't match any of the configured refspecs
      Ignoring refs/heads/master as it doesn't match any of the configured refspecs
      Ignoring refs/heads/historyBookAlarm as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_geo as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_atp as it doesn't match any of the configured refspecs
      Using strategy: Specific revision
      [poll] Last Built Revision: Revision 1d41cbe536045aec37887e191923237f064af7ca (PR-36)
       > git --version # timeout=10
      using GIT_ASKPASS to set credentials GitHub Access Token
       > git ls-remote -h https://github.com/<user>/<repo> # timeout=10
      Found 12 remote heads on https://github.com/<user>/<repo>
      Ignoring refs/heads/refactoring_to_java8 as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test-jenkins as it doesn't match any of the configured refspecs
      Ignoring refs/heads/RC as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test_charla as it doesn't match any of the configured refspecs
      Ignoring refs/heads/jenkins-test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/postsale as it doesn't match any of the configured refspecs
      Ignoring refs/heads/master as it doesn't match any of the configured refspecs
      Ignoring refs/heads/historyBookAlarm as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_geo as it doesn't match any of the configured refspecs
      Ignoring refs/heads/test as it doesn't match any of the configured refspecs
      Ignoring refs/heads/implementing_atp as it doesn't match any of the configured refspecs
      Done. Took 4.9 sec
      No changes
      

      It says "no changes" but it has a new commit.

       

      If I go to the instance and look at the refspecs in the PR folder with:

      su -c "git config --get remote.origin.fetch" -s /bin/sh jenkins
      

      I get

      +refs/heads/dev:refs/remotes/origin/dev
      

      I think there it should be a ref to the pull request, or the origin branch, instead of the "dev" branch which is the pull request destination, in order to detect the update

      I'm using blue ocean with declarative syntax.

      Shouldn't it work without any additional configuration?

      Is there any workaround for this problem just using some code in the pipeline?
      We have the pipeline in a shared library that covers a lot of projects, so it would be easier to fix it just there instead of going to every jenkins installation.

      Thanks!

      Regards.

        Attachments

          Activity

          Hide
          amirbarkal Amir Barkal added a comment - - edited

          Same problem here with jenkins core version 2.150.

          Our use case is setting up a nightly job that can auto-discover newly created branches and trigger builds only if there were SCM changes. I thought I can achieve this by:

          1. Create a multi-branch pipeline job that has the "suppress auto SCM triggering" = on
          (To disable merge/push web hooks)

          2. Enable the "Scan periodically if not otherwise run"
          (To add/remove new/deleted branches)

          3. Add "triggers

          { pollSCM('H 22 * * *') }

          " to the pipeline Jenkinsfile

          Unfortunately I'm getting the same behavior reported by OP. Very annoying...

          Show
          amirbarkal Amir Barkal added a comment - - edited Same problem here with jenkins core version 2.150. Our use case is setting up a nightly job that can auto-discover newly created branches and trigger builds only if there were SCM changes. I thought I can achieve this by: 1. Create a multi-branch pipeline job that has the "suppress auto SCM triggering" = on (To disable merge/push web hooks) 2. Enable the "Scan periodically if not otherwise run" (To add/remove new/deleted branches) 3. Add "triggers { pollSCM('H 22 * * *') } " to the pipeline Jenkinsfile Unfortunately I'm getting the same behavior reported by OP. Very annoying...

            People

            • Assignee:
              lanwen Kirill Merkushev
              Reporter:
              leoxs22 Leandro Narosky
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: