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

Add way to easily test currentBuild result is better/worse than some value (isBetterOrEqualTo)

    Details

    • Similar Issues:

      Description

      Currently currentBuild.result returns a string. This makes testing whether a result is better/worse than some status. This functionality is present in hudson.model.Result as isBetterOrEqualTo and isWorseOrEqualTo

      Suggest one of two solutions:
      1. Wiring this through as currentBuild.resultIsBetterOrEqualTo(String) and currentBuild.resultIsWorseOrEqualTo(String).
      2. Add a currentBuild.resultValue property that returns the raw hudson.model.Result value from which someone could run isBetterOrEqualTo

        Attachments

          Issue Links

            Activity

            Hide
            abayer Andrew Bayer added a comment -
            Show
            abayer Andrew Bayer added a comment - Incorporated this into the fix for JENKINS-42521 at https://github.com/jenkinsci/workflow-support-plugin/pull/31
            Hide
            ringerc Craig Ringer added a comment -

            The specific fix proposed here doesn't give pipelines a way to test the result of a `RunWrapper` from a child build returned by a `build` step with `propagate: false`.

            I whitelisted:

            staticMethod hudson.model.Result fromString java.lang.String
            method hudson.model.Result isWorseThan hudson.model.Result

            Show
            ringerc Craig Ringer added a comment - The specific fix proposed here doesn't give pipelines a way to test the result of a `RunWrapper` from a child build returned by a `build` step with `propagate: false`. I whitelisted: staticMethod hudson.model.Result fromString java.lang.String method hudson.model.Result isWorseThan hudson.model.Result

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                bitwiseman Liam Newman
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: