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

post-build action statuses handling

    XMLWordPrintable

Details

    Description

      perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

      In current situation when you have two publishers:
      1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
      2) if build SUCCESS - do action
      Because of 1) returned boolean build summary result is set to failed.
      So what status will see 2) publisher?
      If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
      If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

      The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
      if branch sets build Result immediately for throwen error and later for boolean.

      Also AbortException shouldn't print stacktraces, issue in ancient code here:
      https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L716-L741

      Attachments

        Issue Links

          Activity

            integer Kanstantsin Shautsou created issue -
            integer Kanstantsin Shautsou made changes -
            Field Original Value New Value
            Description Nobody will fix it in core, but i will describe a root case.
            for perform step returning boolean is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if set build Result immediately for throwen error and later for boolean.
            Nobody will fix it in core, but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if set build Result immediately for throwen error and later for boolean.
            integer Kanstantsin Shautsou made changes -
            Link This issue is related to JENKINS-26936 [ JENKINS-26936 ]
            integer Kanstantsin Shautsou made changes -
            Description Nobody will fix it in core, but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if set build Result immediately for throwen error and later for boolean.
            Nobody will fix it in core(?), but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if set build Result immediately for throwen error and later for boolean.
            integer Kanstantsin Shautsou made changes -
            Description Nobody will fix it in core(?), but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if set build Result immediately for throwen error and later for boolean.
            Nobody will fix it in core(?), but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if branch sets build Result immediately for throwen error and later for boolean.
            integer Kanstantsin Shautsou made changes -
            Description Nobody will fix it in core(?), but i will describe a root case.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if branch sets build Result immediately for throwen error and later for boolean.
            perform method that return boolean for publisher is deprecated now and AbortException with reason message is a new style.

            In current situation when you have two publishers:
            1) If build SUCCESS (build.getResult()) then do action and FAIL the publisher.
            2) if build SUCCESS - do action
            Because of 1) returned boolean build summary result is set to failed.
            So what status will see 2) publisher?
             If 1) publisher fail the build with 'return false', then second publisher will still see SUCCESS state and do unexpected action
             If 1) throw AbortException, then build result will be set to FAILURE and 2) publisher will see correct fail status.

            The error in this place https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L719-L729
            if branch sets build Result immediately for throwen error and later for boolean.

            Also AbortException shouldn't print stacktraces, issue in ancient code here:
            https://github.com/jenkinsci/jenkins/blob/555e2d593fbb419d2fad7e9cfae5911daf3d30e3/core/src/main/java/hudson/model/AbstractBuild.java#L716-L741
            integer Kanstantsin Shautsou made changes -
            Assignee Kanstantsin Shautsou [ integer ]
            integer Kanstantsin Shautsou made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            integer Kanstantsin Shautsou made changes -
            Remote Link This issue links to "jenkins/pull/1577 (Web Link)" [ 12121 ]
            integer Kanstantsin Shautsou made changes -
            Link This issue is related to JENKINS-27066 [ JENKINS-27066 ]
            jglick Jesse Glick added a comment -

            Not sure why JIRA link daemon did not notice the merge here.

            jglick Jesse Glick added a comment - Not sure why JIRA link daemon did not notice the merge here.
            jglick Jesse Glick made changes -
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            integer Kanstantsin Shautsou made changes -
            Labels lts-candidate

            Code changed in jenkins
            User: Kanstantsin Shautsou
            Path:
            core/src/main/java/hudson/model/AbstractBuild.java
            test/src/test/java/hudson/model/FreestyleJobPublisherTest.java
            test/src/test/java/hudson/model/utils/AbortExceptionPublisher.java
            test/src/test/java/hudson/model/utils/IOExceptionPublisher.java
            test/src/test/java/hudson/model/utils/ResultWriterPublisher.java
            test/src/test/java/hudson/model/utils/TrueFalsePublisher.java
            http://jenkins-ci.org/commit/jenkins/e18bde37c9e5f02482eb0ab7394029ff733dbf85
            Log:
            [FIXED JENKINS-26964] Handle AbortException right

            (cherry picked from commit 625a22e63b73bd387d2b33cbb66d3ec05037ea26)

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kanstantsin Shautsou Path: core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/FreestyleJobPublisherTest.java test/src/test/java/hudson/model/utils/AbortExceptionPublisher.java test/src/test/java/hudson/model/utils/IOExceptionPublisher.java test/src/test/java/hudson/model/utils/ResultWriterPublisher.java test/src/test/java/hudson/model/utils/TrueFalsePublisher.java http://jenkins-ci.org/commit/jenkins/e18bde37c9e5f02482eb0ab7394029ff733dbf85 Log: [FIXED JENKINS-26964] Handle AbortException right (cherry picked from commit 625a22e63b73bd387d2b33cbb66d3ec05037ea26)
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate 1.609.
            olivergondza Oliver Gondža made changes -
            Labels 1.609. 1.609.2-fixed
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #4292
            [FIXED JENKINS-26964] Handle AbortException right (Revision e18bde37c9e5f02482eb0ab7394029ff733dbf85)

            Result = UNSTABLE
            ogondza : e18bde37c9e5f02482eb0ab7394029ff733dbf85
            Files :

            • test/src/test/java/hudson/model/FreestyleJobPublisherTest.java
            • test/src/test/java/hudson/model/utils/TrueFalsePublisher.java
            • test/src/test/java/hudson/model/utils/ResultWriterPublisher.java
            • core/src/main/java/hudson/model/AbstractBuild.java
            • test/src/test/java/hudson/model/utils/IOExceptionPublisher.java
            • test/src/test/java/hudson/model/utils/AbortExceptionPublisher.java
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #4292 [FIXED JENKINS-26964] Handle AbortException right (Revision e18bde37c9e5f02482eb0ab7394029ff733dbf85) Result = UNSTABLE ogondza : e18bde37c9e5f02482eb0ab7394029ff733dbf85 Files : test/src/test/java/hudson/model/FreestyleJobPublisherTest.java test/src/test/java/hudson/model/utils/TrueFalsePublisher.java test/src/test/java/hudson/model/utils/ResultWriterPublisher.java core/src/main/java/hudson/model/AbstractBuild.java test/src/test/java/hudson/model/utils/IOExceptionPublisher.java test/src/test/java/hudson/model/utils/AbortExceptionPublisher.java
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-30730 [ JENKINS-30730 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 161151 ] JNJira + In-Review [ 196660 ]

            People

              integer Kanstantsin Shautsou
              integer Kanstantsin Shautsou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: