[JIRA] (JENKINS-41239) Error during always block skips execution of remaining steps

1 view
Skip to first unread message

vivek.pandey@gmail.com (JIRA)

unread,
Mar 13, 2018, 12:09:34 PM3/13/18
to jenkinsc...@googlegroups.com
Vivek Pandey updated an issue
 
Jenkins / Bug JENKINS-41239
Error during always block skips execution of remaining steps
Change By: Vivek Pandey
Sprint: Pipeline - Candidates
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

moritz.baumann@oracle.com (JIRA)

unread,
Mar 21, 2018, 10:26:03 AM3/21/18
to jenkinsc...@googlegroups.com
Moritz Baumann commented on Bug JENKINS-41239
 
Re: Error during always block skips execution of remaining steps

The workaround mentioned here doesn't work for me. Are there any plans to address this issue?

Currently, I have to use

post { always { catchError { ... } cleanWs() } }

everywhere to make sure I always clean up my workspaces. This workaround introduces another bug, though: Incorrect archiveArtifacts configurations in the catchError block will be completely ignored.

moritz.baumann@oracle.com (JIRA)

unread,
Mar 21, 2018, 10:33:03 AM3/21/18
to jenkinsc...@googlegroups.com
Moritz Baumann edited a comment on Bug JENKINS-41239
When I discovered this problem, my first instinct was to add a second _always_ closure, but this failed Jenkins didn't accept that . Maybe allowing this would be a good solution to the underlying problem?

moritz.baumann@oracle.com (JIRA)

unread,
Mar 21, 2018, 10:33:11 AM3/21/18
to jenkinsc...@googlegroups.com

When I discovered this problem, my first instinct was to add a second always closure, but this failed. Maybe allowing this would be a good solution to the underlying problem?

moritz.baumann@oracle.com (JIRA)

unread,
Mar 21, 2018, 10:36:02 AM3/21/18
to jenkinsc...@googlegroups.com
Moritz Baumann edited a comment on Bug JENKINS-41239
When I discovered this problem, my first instinct was to add a second _always_ closure, but Jenkins didn't accept that. Maybe allowing this would be a good solution to the underlying problem?

*Edit*: Sorry, completely missed that this is already mentioned above.

andrew.bayer@gmail.com (JIRA)

unread,
Apr 3, 2018, 4:02:05 PM4/3/18
to jenkinsc...@googlegroups.com
Andrew Bayer started work on Bug JENKINS-41239
 
Change By: Andrew Bayer
Status: Open In Progress

andrew.bayer@gmail.com (JIRA)

unread,
Apr 3, 2018, 4:02:05 PM4/3/18
to jenkinsc...@googlegroups.com

andrew.bayer@gmail.com (JIRA)

unread,
Apr 3, 2018, 4:04:02 PM4/3/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Bug JENKINS-41239
 
Re: Error during always block skips execution of remaining steps

I've got a PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/258 that adds a new post condition, currently called cleanup, which runs regardless of build status but after all the other conditions have resolved.

moritz.baumann@oracle.com (JIRA)

unread,
Apr 4, 2018, 3:44:03 AM4/4/18
to jenkinsc...@googlegroups.com

Andrew Bayer thank you very much! While it doesn't fix the original issue, it very much fixes my use case. Especially the fact that `always` ran before `success` was giving me headaches.

scm_issue_link@java.net (JIRA)

unread,
Apr 17, 2018, 11:47:04 AM4/17/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:
pipeline-model-definition/src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Cleanup.groovy
pipeline-model-definition/src/main/resources/org/jenkinsci/plugins/pipeline/modeldefinition/model/conditions/Messages.properties
pipeline-model-definition/src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/BuildConditionResponderTest.java
pipeline-model-definition/src/test/resources/postChecksAllConditions.groovy
http://jenkins-ci.org/commit/pipeline-model-definition-plugin/83abd0ec35960c1f2a37b6a66b2d26385b2962e2
Log:
[FIXED JENKINS-41239] Add new cleanup post condition

The new `cleanup` condition will always run regardless of build
status, like `always`, but runs after all other `post` conditions
have been evaluated, rather than before.

I wanted to call this `finally` but that actually breaks Groovy
parsing because `finally` is a reserved word. Dang. So for now, I'm
calling it `cleanup`, but am open to suggestions.

andrew.bayer@gmail.com (JIRA)

unread,
Apr 17, 2018, 11:48:02 AM4/17/18
to jenkinsc...@googlegroups.com
 

Merged, releasing later today in Declarative 1.2.9

Change By: Andrew Bayer
Status: In Review Resolved
Resolution: Fixed

scm_issue_link@java.net (JIRA)

unread,
Apr 18, 2018, 1:16:02 PM4/18/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: Andrew Bayer
Path:

content/doc/book/pipeline/syntax.adoc
http://jenkins-ci.org/commit/jenkins.io/c8c7bce2e7c5955d5176f0791800156cf0c087a2
Log:
JENKINS-41239 Add doc for new cleanup post condition.

This was just released in Declarative 1.2.9 so this should be ready to
go whenever works for you.

scm_issue_link@java.net (JIRA)

unread,
Apr 18, 2018, 1:16:04 PM4/18/18
to jenkinsc...@googlegroups.com

Code changed in jenkins
User: R. Tyler Croy
Path:
content/doc/book/pipeline/syntax.adoc
http://jenkins-ci.org/commit/jenkins.io/5c434e826c79dc06f837a6d244c9ddf5df1fa382
Log:
Merge pull request #1504 from abayer/jenkins-41239

JENKINS-41239 Add doc for new cleanup post condition.

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:25:35 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