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

Null pointer exception in JGit pre-build merge

    Details

    • Similar Issues:

      Description

      When attempting a pre-build merge with JGit a null pointer exception is reported. The stack trace is:

      java.lang.NullPointerException
      	at hudson.plugins.git.util.GitUtils.getRevisionForSHA1(GitUtils.java:166)
      	at hudson.plugins.git.extensions.impl.PreBuildMerge.decorateRevisionToBuild(PreBuildMerge.java:119)
      	at hudson.plugins.git.GitSCM.determineRevisionToBuild(GitSCM.java:1058)
      	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1151)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:120)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:90)
      	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:77)
      	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      

      Refer to my jenkins-bugs test repository for the details.

      The failure is specific to the JGit implementation. It was not visible in the command line git implementation.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Thanks for doing that. Your experience matches mine when exploring a bug. By the time I've duplicated the bug in a unit test, I've understood it well enough that the bug fix is simple compared to all the learning that preceded it.

          Show
          markewaite Mark Waite added a comment - Thanks for doing that. Your experience matches mine when exploring a bug. By the time I've duplicated the bug in a unit test, I've understood it well enough that the bug fix is simple compared to all the learning that preceded it.
          Hide
          markewaite Mark Waite added a comment -

          Brian Ray I'm starting the planning so that we can release a new version of the git plugin in the next 1-2 weeks. I'd love to include this fix in a git client plugin release at the same time, if it is ready. Thanks again for your work on it!

          There are 3 pull requests to the git plugin that need to be evaluated and merged before the release. Wanted you to know the plans for the release in case that information helps you.

          Show
          markewaite Mark Waite added a comment - Brian Ray I'm starting the planning so that we can release a new version of the git plugin in the next 1-2 weeks. I'd love to include this fix in a git client plugin release at the same time, if it is ready. Thanks again for your work on it! There are 3 pull requests to the git plugin that need to be evaluated and merged before the release. Wanted you to know the plans for the release in case that information helps you.
          Hide
          brianeray Brian Ray added a comment -

          Thanks Mark Waite. PR is imminent, Monday at the latest but more likely this afternoon.

          The full Git Client test suite just finished up here on my local, rebased-to-fresh-master branch. 100% success and and coverage on getTags() via Jacoco (largely in thanks to existing tests to be sure).

          After grabbing some lunch I should be able slip the plugin into my test Jenkins and confirm the downstream NPE is squashed.

          Show
          brianeray Brian Ray added a comment - Thanks Mark Waite . PR is imminent, Monday at the latest but more likely this afternoon. The full Git Client test suite just finished up here on my local, rebased-to-fresh-master branch. 100% success and and coverage on getTags() via Jacoco (largely in thanks to existing tests to be sure). After grabbing some lunch I should be able slip the plugin into my test Jenkins and confirm the downstream NPE is squashed.
          Hide
          markewaite Mark Waite added a comment -

          Expected to release in git client plugin 3.1.2 within the next 2 weeks

          Show
          markewaite Mark Waite added a comment - Expected to release in git client plugin 3.1.2 within the next 2 weeks
          Hide
          markewaite Mark Waite added a comment -

          Release in git client plugin 3.2.0 March 1, 2020.

          Show
          markewaite Mark Waite added a comment - Release in git client plugin 3.2.0 March 1, 2020.

            People

            • Assignee:
              brianeray Brian Ray
              Reporter:
              markewaite Mark Waite
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: