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

Support post conditions that accept a range of stage statuses

      For users of declarative pipeline, there are problems with coding 'post' conditions to handle stages that might come up as UNSTABLE rather than SUCCESS if a test fails. This means if a stage is unstable, then the 'success' condition will break. See example: https://issues.jenkins.io/browse/JENKINS-39203?focusedCommentId=350537&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-350537

      Solving this requires writing separate post conditions for each possible status.

      Instead, it would be very good to support a 'statusGreaterThanOrEqual' condition that takes a Result code and runs if it's better than it (and perhaps statusLessThan, etc).

          [JENKINS-53889] Support post conditions that accept a range of stage statuses

          Sam Van Oort added a comment -

          The worst aspects of the unstable status handling are resolved by this.

          Sam Van Oort added a comment - The worst aspects of the unstable status handling are resolved by this.

          Andrew Bayer added a comment -

          post has some design flaws - most notably that it can't take parameters. So we can implement unstableOrBetter, but not statusOrBetter(SOME_STATUS), fyi.

          Andrew Bayer added a comment - post has some design flaws - most notably that it can't take parameters. So we can implement unstableOrBetter , but not statusOrBetter(SOME_STATUS) , fyi.

          Sam Van Oort added a comment -

          abayer That would work - probably unstableOrBetter, and failureOrWorse would do the trick for 95% of users.

          Sam Van Oort added a comment - abayer That would work - probably unstableOrBetter, and failureOrWorse would do the trick for 95% of users.

            Unassigned Unassigned
            svanoort Sam Van Oort
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: