[JIRA] (JENKINS-53167) Add ability to always run particular stages when restarting

12 views
Skip to first unread message

badevcich@gmail.com (JIRA)

unread,
Aug 21, 2018, 10:30:02 AM8/21/18
to jenkinsc...@googlegroups.com
Blake Devcich created an issue
 
Jenkins / Improvement JENKINS-53167
Add ability to always run particular stages when restarting
Issue Type: Improvement Improvement
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2018-08-21 14:29
Priority: Minor Minor
Reporter: Blake Devcich

I would like to have the ability when restarting a pipeline to always execute a block before the restarted stages begin. The reasoning for this is that I may have some job setup that must always occur when restarting a particular stage.

For example, consider the following:

Setup -> Stage 1 -> Stage 2 -> Stage 3

Let's say I would like to restart from Stage 2 but it needs the setup stage to function properly. Picking Stage 2 as the restart point would then trigger Setup, Stage 2, and then Stage 3.

We already have a post block, so perhaps it would make sense to have a pre block that can be configured to run when a pipeline is restarted.

I realize that it's probably a best practice to have each stage be modular and self-contained, but we have some data we must lay down on the  node that is unique to each run and later stages depend on it. Currently, it's just the first stage in our pipeline and it does not run if we restart the pipeline at a later stage.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

badevcich@gmail.com (JIRA)

unread,
Aug 21, 2018, 10:32:02 AM8/21/18
to jenkinsc...@googlegroups.com
Blake Devcich updated an issue
Change By: Blake Devcich
I would like to have the ability when restarting a pipeline to always execute a block before the restarted stages begin. The reasoning for this is that I may have some job setup that must always occur when restarting a particular stage.

For example, consider the following:

Setup -> Stage 1 -> Stage 2 -> Stage 3

Let's say I would like to restart from Stage 2 but it needs the setup stage to function properly. Picking Stage 2 as the restart point would then trigger Setup, Stage 2, and then Stage 3.

We already have a post block, so perhaps it would make sense to have a pre block that can be configured to run when a pipeline is restarted . ? Or perhaps you can just mark a stage to run even when restarted?

I realize that it's probably a best practice to have each stage be modular and self-contained, but we have some data we must lay down on the  node that is unique to each run and later stages depend on it. Currently, it's just the first stage in our pipeline and it does not run if we restart the pipeline at a later stage.


We had a small discussion regarding this in JENKINS-51932.

andrew.bayer@gmail.com (JIRA)

unread,
Aug 22, 2018, 3:09:01 PM8/22/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on Improvement JENKINS-53167
 
Re: Add ability to always run particular stages when restarting

This is an interesting possibility - no guarantees, but this does feel worth considering.

andrew.bayer@gmail.com (JIRA)

unread,
Nov 16, 2018, 1:26:03 PM11/16/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated an issue
 
Change By: Andrew Bayer
Labels: stage-restart-improvements
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jonathankuleff+jenkins@gmail.com (JIRA)

unread,
May 5, 2019, 9:15:02 AM5/5/19
to jenkinsc...@googlegroups.com
Jonathan Kuleff commented on Improvement JENKINS-53167
 
Re: Add ability to always run particular stages when restarting

I would really like this feature too.

I have 2 use cases for this feature, the first is I would like to send a notification when a pipeline starts regardless of how it was triggered, there is no real nice way to do this currently for stage restarts.

The second use case is I want to load some config/metadata that was generated from a skipped stage allowing me to restart from any stage, however because I can't know which will be the restarted stage I need to try load it in every stage and this just makes my Jenkinsfile look unnecessarily cluttered.

In both cases having a pipeline pre stage would simplify my Jenkinsfile and declutter it making it easier to read and maintain

harshavmb@gmail.com (JIRA)

unread,
May 14, 2019, 9:39:04 AM5/14/19
to jenkinsc...@googlegroups.com

This is one of the cool features we would like to have with jenkins. Many of our use cases are built around this and it really makes life much easier to restart the stage in parallel stages. 

varuag.chhabra@gmail.com (JIRA)

unread,
Jun 25, 2019, 8:05:02 AM6/25/19
to jenkinsc...@googlegroups.com

I am also looking for this functionality for my use case. If my scm checkout and build phases run fine but test case execution fails, then in such case, i would like to run the checkout (which will now have fix for test case issue) and test case again but skip the build phase. Actually, the ability to run a particular phase as an optional feature will be the most ideal situation for me.

Reply all
Reply to author
Forward
0 new messages