[JIRA] (JENKINS-39631) Declarative plugin adds extra step for failed step but doesn't mark it as error

1 view
Skip to first unread message

vivek.pandey@gmail.com (JIRA)

unread,
Nov 9, 2016, 9:31:01 PM11/9/16
to jenkinsc...@googlegroups.com
Vivek Pandey created an issue
 
Jenkins / Bug JENKINS-39631
Declarative plugin adds extra step for failed step but doesn't mark it as error
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2016/Nov/10 2:30 AM
Priority: Major Major
Reporter: Vivek Pandey

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. Sam Van Oort, 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 object otherwise it defeats the purpose.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

vivek.pandey@gmail.com (JIRA)

unread,
Nov 9, 2016, 9:34:01 PM11/9/16
to jenkinsc...@googlegroups.com
Vivek Pandey updated an issue
Change By: Vivek Pandey
Running following code:

{code:java}

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

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
object otherwise , 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.

Andrew Bayer

unread,
Nov 9, 2016, 9:37:21 PM11/9/16
to jenkinsc...@googlegroups.com

Last I looked, there was no way to do that - correct me if I'm wrong, Sam.

andrew.bayer@gmail.com (JIRA)

unread,
Nov 10, 2016, 12:31:01 PM11/10/16
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-39631
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Nov 10, 2016, 12:33:01 PM11/10/16
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-39631
 
Re: Declarative plugin adds extra step for failed step but doesn't mark it as error

So I'm now trying out adding an ErrorAction to the stage FlowNode - does that do what you need?

andrew.bayer@gmail.com (JIRA)

unread,
Nov 10, 2016, 2:24:01 PM11/10/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Nov 10, 2016, 2:25:13 PM11/10/16
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Nov 10, 2016, 2:25:13 PM11/10/16
to jenkinsc...@googlegroups.com

Check that - I see what's needed. Moving the error to the last step in the stage instead.

scm_issue_link@java.net (JIRA)

unread,
Nov 14, 2016, 7:28:02 PM11/14/16
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-definition/pom.xml
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/Utils.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/ModelInterpreter.groovy
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BasicModelDefTest.java
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/1d397c25acff419a0a82611e0f5ae13679b9639f
Log:
[FIXED JENKINS-39631] Last step in failed stage has an error.

andrew.bayer@gmail.com (JIRA)

unread,
Nov 14, 2016, 7:30:04 PM11/14/16
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:47 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages