• Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • None

      Currently the build step will either return Result.SUCCESS, or fail. It should rather return some POJO with whitelisted methods to get the result, get a number/URL, set a description, and so on.

      The obvious fix is to just return the Run. The problem is how to allow setDescription. This checks UPDATE, so as a rule it should be allowed only when running with a defined authentication. But flows usually do not run with any authentication, in which case this would fail—even though we should arguably always allow it on a build we triggered ourselves. On the other hand, it is desirable going forward to ask for authentication on projects, in which case you would need some permission on the downstream project to trigger its build anyway.

      Compatibility: the current return value is useless and so no one would be relying on it, but some scripts may be relying on a non-stable downstream build failing the flow, so it should be an option to allow the flow to proceed even if the downstream build is not stable (in which case the new return value takes effect).

          [JENKINS-25851] Richer return value for build step

          Jesse Glick added a comment -

          A caveat when returning Run is that this is not serializable, and so may not be used as the return value of a step—unless RunPickle is created to save it safely.

          Jesse Glick added a comment - A caveat when returning Run is that this is not serializable, and so may not be used as the return value of a step—unless RunPickle is created to save it safely.

          Jesse Glick added a comment -

          Cf. this discussion about being able to access the Run for this build.

          Jesse Glick added a comment - Cf. this discussion about being able to access the Run for this build.

          Jesse Glick added a comment -

          Should also be able to access build variables (for an AbstractBuild) as a Map<String,String>.

          Jesse Glick added a comment - Should also be able to access build variables (for an AbstractBuild ) as a Map<String,String> .

          Jesse Glick added a comment -

          JENKINS-26670 would be needed for setDescription (a special exemption could be made for the current build).

          Jesse Glick added a comment - JENKINS-26670 would be needed for setDescription (a special exemption could be made for the current build).

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
          support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java
          support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/help-wait.html
          http://jenkins-ci.org/commit/workflow-plugin/98dde1e70b6b8af5bf42891bf5261a6e8fa794b5
          Log:
          JENKINS-25851 Return downstream build object.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/help-wait.html http://jenkins-ci.org/commit/workflow-plugin/98dde1e70b6b8af5bf42891bf5261a6e8fa794b5 Log: JENKINS-25851 Return downstream build object.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          http://jenkins-ci.org/commit/workflow-plugin/0961645bc9e07321fbfc31aaf318ffc93f377cbc
          Log:
          Refining JENKINS-25851 description slightly.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md http://jenkins-ci.org/commit/workflow-plugin/0961645bc9e07321fbfc31aaf318ffc93f377cbc Log: Refining JENKINS-25851 description slightly.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java
          support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java
          support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/help-wait.html
          http://jenkins-ci.org/commit/pipeline-build-step-plugin/23bcc93e7df67e86a8da075fd631132dc102b9ed
          Log:
          JENKINS-25851 Return downstream build object.
          Originally-Committed-As: 98dde1e70b6b8af5bf42891bf5261a6e8fa794b5

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: aggregator/src/test/java/org/jenkinsci/plugins/workflow/steps/build/BuildTriggerStepTest.java support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerListener.java support/src/main/resources/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep/help-wait.html http://jenkins-ci.org/commit/pipeline-build-step-plugin/23bcc93e7df67e86a8da075fd631132dc102b9ed Log: JENKINS-25851 Return downstream build object. Originally-Committed-As: 98dde1e70b6b8af5bf42891bf5261a6e8fa794b5

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: