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

AbstractBuildExecution#reportError should work will any kind of Build Step

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      AbstractBuildExecution#reportError should work will any kind of Build Step.

      Right now, reportError supposes that all the build steps are Publishers, but according with the code it should work with any kind of BuildStep.

              private void reportError(BuildStep bs, Throwable e, BuildListener listener, boolean phase) {
                  final String publisher = ((Publisher) bs).getDescriptor().getDisplayName();
      
                  if (e instanceof AbortException) {
                      LOGGER.log(Level.FINE, "{0} : {1} failed", new Object[] {AbstractBuild.this, publisher});
                      listener.error("Publisher '" + publisher + "' failed: ");
                      listener.error(e.getMessage());
                  } else {
                      String msg = "Publisher '" + publisher + "' aborted due to exception: ";
                      e.printStackTrace(listener.error(msg));
                      LOGGER.log(WARNING, msg, e);
                  }
      
                  if (phase) {
                      setResult(Result.FAILURE);
                  }
              }
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            This seems to be a regression in the LTS, preventing proper error diagnosis (even AbortException for user mistakes—not necessarily just plugin bugs), so I am proposing it for backport.

            Show
            jglick Jesse Glick added a comment - This seems to be a regression in the LTS, preventing proper error diagnosis (even AbortException for user mistakes—not necessarily just plugin bugs), so I am proposing it for backport.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/AbstractBuild.java
            test/src/test/java/hudson/model/AbstractBuildTest2.java
            http://jenkins-ci.org/commit/jenkins/725b6afeac4ac5b8821c095f3b093cd0daa3a526
            Log:
            [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher.

            This pull request integrates https://github.com/jenkinsci/jenkins/pulls/1851, which is a reworked version of https://github.com/jenkinsci/jenkins/pull/1846 from @fbelzunc (no original codelines left)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/AbstractBuildTest2.java http://jenkins-ci.org/commit/jenkins/725b6afeac4ac5b8821c095f3b093cd0daa3a526 Log: [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. This pull request integrates https://github.com/jenkinsci/jenkins/pulls/1851 , which is a reworked version of https://github.com/jenkinsci/jenkins/pull/1846 from @fbelzunc (no original codelines left)
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: changelog.html http://jenkins-ci.org/commit/jenkins/6a65371e5beb74d113557eaed5c51c33b8130984 Log: Noting JENKINS-30730 from #1851 Compare: https://github.com/jenkinsci/jenkins/compare/0a36f743f1fd...6a65371e5beb
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4327
            [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. (Revision 725b6afeac4ac5b8821c095f3b093cd0daa3a526)
            Noting JENKINS-30730 from #1851 (Revision 6a65371e5beb74d113557eaed5c51c33b8130984)

            Result = SUCCESS
            o.v.nenashev : 725b6afeac4ac5b8821c095f3b093cd0daa3a526
            Files :

            • test/src/test/java/hudson/model/AbstractBuildTest2.java
            • core/src/main/java/hudson/model/AbstractBuild.java

            o.v.nenashev : 6a65371e5beb74d113557eaed5c51c33b8130984
            Files :

            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4327 [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. (Revision 725b6afeac4ac5b8821c095f3b093cd0daa3a526) Noting JENKINS-30730 from #1851 (Revision 6a65371e5beb74d113557eaed5c51c33b8130984) Result = SUCCESS o.v.nenashev : 725b6afeac4ac5b8821c095f3b093cd0daa3a526 Files : test/src/test/java/hudson/model/AbstractBuildTest2.java core/src/main/java/hudson/model/AbstractBuild.java o.v.nenashev : 6a65371e5beb74d113557eaed5c51c33b8130984 Files : changelog.html
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/model/AbstractBuild.java
            test/src/test/java/hudson/model/AbstractBuildTest2.java
            http://jenkins-ci.org/commit/jenkins/3af6c6b815e7599e6f1bc59555ee6db9fdb36392
            Log:
            [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher.

            This pull request integrates https://github.com/jenkinsci/jenkins/pulls/1851, which is a reworked version of https://github.com/jenkinsci/jenkins/pull/1846 from @fbelzunc (no original codelines left)

            (cherry picked from commit 725b6afeac4ac5b8821c095f3b093cd0daa3a526)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/AbstractBuildTest2.java http://jenkins-ci.org/commit/jenkins/3af6c6b815e7599e6f1bc59555ee6db9fdb36392 Log: [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. This pull request integrates https://github.com/jenkinsci/jenkins/pulls/1851 , which is a reworked version of https://github.com/jenkinsci/jenkins/pull/1846 from @fbelzunc (no original codelines left) (cherry picked from commit 725b6afeac4ac5b8821c095f3b093cd0daa3a526)
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4358
            [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. (Revision 3af6c6b815e7599e6f1bc59555ee6db9fdb36392)

            Result = UNSTABLE
            ogondza : 3af6c6b815e7599e6f1bc59555ee6db9fdb36392
            Files :

            • test/src/test/java/hudson/model/AbstractBuildTest2.java
            • core/src/main/java/hudson/model/AbstractBuild.java
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4358 [FIXED JENKINS-30730] Prevent ClassCastException in Abstractbuild::reportError() if the build step is not Publisher. (Revision 3af6c6b815e7599e6f1bc59555ee6db9fdb36392) Result = UNSTABLE ogondza : 3af6c6b815e7599e6f1bc59555ee6db9fdb36392 Files : test/src/test/java/hudson/model/AbstractBuildTest2.java core/src/main/java/hudson/model/AbstractBuild.java

              People

              • Assignee:
                fbelzunc Félix Belzunce Arcos
                Reporter:
                fbelzunc Félix Belzunce Arcos
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: