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

Declarative plugin adds extra step for failed step but doesn't mark it as error

XMLWordPrintable

      Running following code:

      pipeline {
          agent label: ''
          stages {
              stage ('Build') {
                  steps{
                    sh 'echo1 "Building"'
                  }
              }
              stage ('Test') {
                  steps{
                    sh 'echo "Test"'
                  }
              }
              stage ('Deploy') {
                  steps{
                    sh 'echo "Building"'
                  }
              }
          }
      }
      

      Only step in Build stage fails, declarative plugin adds extra print step to print there was failure however this step is not marked as error resulting in failure to mark the stage as error using StatusAndTiming.computeChunkStatus() api, which reports status of stage based on last step. That is if last sep was success, that means all is well. svanoort, this also shows up 'Build' stage as success in stage view plugin.

      Intent of declarative plugin is to report error that running that stage failed, this extra step it injects should have step.getError() return an error, that is FlowNode.getError().getError() returns a well known throwable to identify stage failed to run, StageExecutionFailure or something like that? Otherwise it defeats the purpose of marking stage as failure using StatusAndTiming.computeChunkStatus() API.

            abayer Andrew Bayer
            vivek Vivek Pandey
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: