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

NPE using the Plugin in a pipeline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Component/s: last-changes-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.19.1
      OpenJDK 1.8_102
    • Similar Issues:

      Description

      The plugin does not work in combination with a standard multibranch pipeline project. I have added a pipeline step for the LastChangesPublisher, which has been suggested by the snippet generator.

      My Jenkinsfile looks like:

      node('master') {
      stage('prep')

      { checkout scm step([$class: 'LastChangesPublisher', format: 'LINE', matchWordsThreshold: '0.25', matching: 'NONE', matchingMaxComparisons: '1000', showFiles: true, synchronisedScroll: true]) }

      }

      My SCM system is Git and configured in the project configuration. As soon as Jenkins reaches the LastChangesPublisher step, the job exists with the following NPE:

      java.lang.NullPointerException
      at com.github.jenkins.lastchanges.LastChangesPublisher.perform(LastChangesPublisher.java:97)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:69)
      at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:59)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:52)
      at hudson.security.ACL.impersonate(ACL.java:221)
      at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:49)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Issue Links

            Activity

            Hide
            rmpestano Rafael Pestano added a comment - - edited

            just out of curiosity, how is your step? as I'm not using the new pipeline I don't know what you can do with it, maybe we can just expose a few methods and we are done.

            Show
            rmpestano Rafael Pestano added a comment - - edited just out of curiosity, how is your step? as I'm not using the new pipeline I don't know what you can do with it, maybe we can just expose a few methods and we are done.
            Hide
            rmpestano Rafael Pestano added a comment -

            I've just created an issue for this here: https://github.com/jenkinsci/last-changes-plugin/issues/3 

             

            So in next version it will be possible to specify a revision instead of always comparing with previous one.

            Show
            rmpestano Rafael Pestano added a comment - I've just created an issue for this here: https://github.com/jenkinsci/last-changes-plugin/issues/3     So in next version it will be possible to specify a revision instead of always comparing with previous one.
            Hide
            rmpestano Rafael Pestano added a comment - - edited

            Hi again, just implemented the ability to specify a revision instead of always comparing with previous one.  For pipeline usage the new parameter name is 'endRevision'. I've attached the new version here and it would be nice if you could test: last-changes.hpi 

             

            Thanks for all the feedback.

             

            Show
            rmpestano Rafael Pestano added a comment - - edited Hi again, just implemented the ability to specify a revision instead of always comparing with previous one.  For pipeline usage the new parameter name is 'endRevision'. I've attached the new version here and it would be nice if you could test: last-changes.hpi     Thanks for all the feedback.  
            Hide
            rmpestano Rafael Pestano added a comment -

            I've just released 1.0.7 and will close this issue. 

             

             

            Show
            rmpestano Rafael Pestano added a comment - I've just released 1.0.7 and will close this issue.     
            Hide
            rmpestano Rafael Pestano added a comment -

            Fixed for v1.0.7

            Show
            rmpestano Rafael Pestano added a comment - Fixed for v1.0.7

              People

              Assignee:
              rmpestano Rafael Pestano
              Reporter:
              rabu rabu rabu
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: