Details
-
Type:
Improvement
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Fixed
-
Component/s: workflow-support-plugin
-
Labels:None
-
Similar Issues:
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
- relates to
-
WEBSITE-364 Update "currentBuild.result" docs and examples to use currentBuilt.currentResult and resultIsBetter/IsWorse
-
- To Do
-
- links to
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.