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

jenkins-cli.jar: set-build-description command fails with NPE for non-existent build

      We use "jenkins-cli.jar set-build-description" command for integration with external CI systems - they record build number, do their processing, then post status back to jenkins by updating build description. Sometimes, recorded build number no longer exists (e.g. was expired), and in thsi case, set-build-description command fails with NullPointerException (and exist code of 255). Of course, NPE isn't selective enough to differentiate "build doesn't exist" (warning-like condition) from more serious error which may require closer attention.

      It would be nice if set-build-description checked build existence, and exited with specific error message and specific exit code for easy scripting.

          [JENKINS-33942] jenkins-cli.jar: set-build-description command fails with NPE for non-existent build

          Daniel Beck added a comment -

          pajasoft You may be interested in this one.

          Daniel Beck added a comment - pajasoft You may be interested in this one.

          Ok, I can see this issue in the code, will fix it.

          Pavel Janoušek added a comment - Ok, I can see this issue in the code, will fix it.

          PR sent.

          Pavel Janoušek added a comment - PR sent.

          Code changed in jenkins
          User: Ing. Pavel Janousek
          Path:
          core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java
          http://jenkins-ci.org/commit/jenkins/575c1af489a43a6bc1846ca46864e5d4931e47e3
          Log:
          JENKINS-33942 Fixed NPE when non-exists run requested

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ing. Pavel Janousek Path: core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java http://jenkins-ci.org/commit/jenkins/575c1af489a43a6bc1846ca46864e5d4931e47e3 Log: JENKINS-33942 Fixed NPE when non-exists run requested

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java
          http://jenkins-ci.org/commit/jenkins/511ccf0c836651d1d825c062d7d42338438c735c
          Log:
          Merge pull request #2230 from pjanouse/JENKINS-33942

          [FIX JENKINS-33942] Fixed NPE when non-exists run requested

          Compare: https://github.com/jenkinsci/jenkins/compare/0846358bf627...511ccf0c8366

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java http://jenkins-ci.org/commit/jenkins/511ccf0c836651d1d825c062d7d42338438c735c Log: Merge pull request #2230 from pjanouse/ JENKINS-33942 [FIX JENKINS-33942] Fixed NPE when non-exists run requested Compare: https://github.com/jenkinsci/jenkins/compare/0846358bf627...511ccf0c8366

          Thanks for quick turnaround!

          Paul Sokolovsky added a comment - Thanks for quick turnaround!

          dogfood added a comment -

          Integrated in jenkins_main_trunk #4549
          JENKINS-33942 Fixed NPE when non-exists run requested (Revision 575c1af489a43a6bc1846ca46864e5d4931e47e3)

          Result = SUCCESS
          pjanouse : 575c1af489a43a6bc1846ca46864e5d4931e47e3
          Files :

          • core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java

          dogfood added a comment - Integrated in jenkins_main_trunk #4549 JENKINS-33942 Fixed NPE when non-exists run requested (Revision 575c1af489a43a6bc1846ca46864e5d4931e47e3) Result = SUCCESS pjanouse : 575c1af489a43a6bc1846ca46864e5d4931e47e3 Files : core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java

            pajasoft Pavel Janoušek
            pfalcon Paul Sokolovsky
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: