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

RunWrapper should have a "getCurrentResult()" method

    XMLWordPrintable

Details

    Description

      Specifically, I think it makes sense to have a RunWrapper.getCurrentResult() method that never returns null. That is, it should return Result.SUCCESS if run.getResult() is null, since users consistently get confused by RunWrapper.getResult() returning null.

      Attachments

        Issue Links

          Activity

            abayer Andrew Bayer added a comment - PR up at  https://github.com/jenkinsci/workflow-support-plugin/pull/31

            Code changed in jenkins
            User: Andrew Bayer
            Path:
            src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java
            src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapperTest.java
            http://jenkins-ci.org/commit/workflow-support-plugin/26b089847fb20d164f45424f757cef6da7ffc56c
            Log:
            [FIXED JENKINS-42521] Add RunWrapper.getCurrentResult()

            getCurrentResult() will never be null - if build().getResult() is
            null, it'll return Result.SUCCESS.toString(). In a perfect world, I'd
            change RunWrapper.getResult() to this behavior, but that'd possibly
            break existing logic out in the wild, so a new method it is.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapper.java src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/RunWrapperTest.java http://jenkins-ci.org/commit/workflow-support-plugin/26b089847fb20d164f45424f757cef6da7ffc56c Log: [FIXED JENKINS-42521] Add RunWrapper.getCurrentResult() getCurrentResult() will never be null - if build().getResult() is null, it'll return Result.SUCCESS.toString(). In a perfect world, I'd change RunWrapper.getResult() to this behavior, but that'd possibly break existing logic out in the wild, so a new method it is.

            People

              abayer Andrew Bayer
              abayer Andrew Bayer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: