[JIRA] (JENKINS-45455) Restarting stages

15 views
Skip to first unread message

andrew.bayer@gmail.com (JIRA)

unread,
Feb 21, 2018, 11:04:12 AM2/21/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on New Feature JENKINS-45455
 
Re: Restarting stages

Forgot to link the work in progress PR - https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/228

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

vivek.pandey@gmail.com (JIRA)

unread,
Feb 27, 2018, 12:17:05 AM2/27/18
to jenkinsc...@googlegroups.com
Vivek Pandey updated an issue
 
Jenkins / New Feature JENKINS-45455
Restarting stages
Change By: Vivek Pandey
Sprint: Pipeline - December March 2018

jenkins@garbe.io (JIRA)

unread,
Mar 28, 2018, 4:05:12 AM3/28/18
to jenkinsc...@googlegroups.com
Philipp Garbe commented on New Feature JENKINS-45455
 
Re: Restarting stages

Are there any updates?

denis.krizanovic@gmail.com (JIRA)

unread,
Apr 2, 2018, 2:29:03 AM4/2/18
to jenkinsc...@googlegroups.com
denis krizanovic commented on New Feature JENKINS-45455
 
Re: Restarting stages

This is a big feature for me. Considering the code is almost done, when might it hit the plugin? 

jbriden@cloudbees.com (JIRA)

unread,
Apr 30, 2018, 6:24:05 PM4/30/18
to jenkinsc...@googlegroups.com
Jenn Briden commented on New Feature JENKINS-45455
 
Re: Restarting stages

denis krizanovic, we are working through the user experience design now to be sure that we take various use cases into account. We have an offsite next week with the Blue Ocean and Pipeline teams, and one of our sessions is to define that UX. We'll then need to do that work. I cannot commit to a specific timeline for when it will be merged to the main Blue Ocean plugin, but we are working on it. I will be sure to update this ticket after our offsite, as well as the corresponding ticket for the UX.

will.saxon@greenwayhealth.com (JIRA)

unread,
Apr 30, 2018, 6:28:04 PM4/30/18
to jenkinsc...@googlegroups.com
Will Saxon commented on New Feature JENKINS-45455
 
Re: Restarting stages

So is this a Blue Ocean feature, or a Pipeline feature? I know I would be pleased to have restart capability even if it was outside Blue Ocean, even if it was just an API call.

sean.williams@cox.com (JIRA)

unread,
May 1, 2018, 8:41:04 AM5/1/18
to jenkinsc...@googlegroups.com
Sean Williams commented on New Feature JENKINS-45455
 
Re: Restarting stages

Thanks for the update Jenn. Will asks a good question. I hope this is a pipeline feature - we are using declarative, but not blue ocean. While Blue Ocean is very pretty and looks very promising, we can't switch until it's all encompassing. But we do need the restart functionality. Or perhaps I'm just confused and the pipeline rendering itself is part of Blue Ocean without even having BO enabled...

andrew.bayer@gmail.com (JIRA)

unread,
May 1, 2018, 10:48:05 AM5/1/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on New Feature JENKINS-45455
 
Re: Restarting stages

Sean Williams Will Saxon - this will not be Blue Ocean-exclusive - there'll be a classic UI for it, you can interact with it via the REST API, etc. We're just holding up merging/releasing it because we want to make sure we've got the Blue Ocean user experience for stage restarting nailed down and on its way to completion beforehand, so that we know the Blue Ocean side is coming soon and we know that the Declarative side doesn't need to be changed post-release to work with the right approach in the Blue Ocean UX. Coordination is fun. =)

(also we've got to get JENKINS-46809 merged before we can merge this, and that little bugger requires, at a minimum, updates to the Blue Ocean Pipeline editor to handle changes to the intermediate representation of a Declarative Pipeline or it just blows up horribly)

klavs@vaivars.com (JIRA)

unread,
May 23, 2018, 8:47:03 AM5/23/18
to jenkinsc...@googlegroups.com
Klavs Dzelzs-Vaivars commented on New Feature JENKINS-45455
 
Re: Restarting stages

Just to add - this really is a feature that we are looking forward to. Are there any potential estimates of how long 46809 might take to push through? 

jbriden@cloudbees.com (JIRA)

unread,
May 23, 2018, 4:47:04 PM5/23/18
to jenkinsc...@googlegroups.com
Jenn Briden commented on New Feature JENKINS-45455
 
Re: Restarting stages

Klavs Dzelzs-Vaivars, I cannot commit us to a specific date, except to say that it's our top priority right now.

jbriden@cloudbees.com (JIRA)

unread,
May 23, 2018, 4:52:04 PM5/23/18
to jenkinsc...@googlegroups.com
 
Re: Restarting stages

Sean Williams, will you please email me at jbr...@gmail.com so that we can discuss your feedback about the gaps that you see in the pipeline visualization UX that you see in Blue Ocean? I can also connect via the Jenkins IRC or gitter, if those are better for you.

kutzi@gmx.de (JIRA)

unread,
Jun 15, 2018, 7:26:10 AM6/15/18
to jenkinsc...@googlegroups.com
kutzi commented on New Feature JENKINS-45455
 
Re: Restarting stages

Great feature!

When it says 'Declarative pipeline only' - does it mean strictly only declarative pipeline feature or are script blocks in declarative pipelines supported as well?

jglick@cloudbees.com (JIRA)

unread,
Jun 15, 2018, 4:52:02 PM6/15/18
to jenkinsc...@googlegroups.com
Jesse Glick commented on New Feature JENKINS-45455
 
Re: Restarting stages

Should this be Resolved/Fixed?

kranjith490@gmail.com (JIRA)

unread,
Jun 18, 2018, 4:27:04 AM6/18/18
to jenkinsc...@googlegroups.com
ranjith kumar updated an issue
Change By: ranjith kumar
*Use cases*
* Restarting a successful stage so to rollback or redeploy code
*  When long running Pipelines fail intermittently for environmental purposes the developer must be able to restart the execution of the stage that failed within the Pipeline. This allows the developer to recoup time lost running the pipeline to the point of failure.

*In scope*
* Declarative pipeline only
* Restart the stage with the same parameters/scm/actions as the previous run
* No management of workspace
* Need to be able to union the previous run and the current runs flownodes to produce a  visualisation for Blue Ocean
** Implication is we do not have to copy flow nodes to the new run
* Add a {{when}} condition that will evaluate as true only when on a restarted
run.  

*Out of scope*
* Automatically stash/unstash the workspace
* Scripted pipeline (technical limitation)

*Open questions*
* Should we be keeping stash data for every run? What is the option of least surprise?


** JD thinks that keeping stashes around by default is the least surprising option - that way they do not have to turn anything on to make the feature work.
** AB says this might blow out the storage requirements

*Notes*
There is less complexity and edge cases needed to be handled by making this functionality a Declarative Pipeline feature only.



*Technical notes*
Split off from JENKINS-33846 since [~abayer] removed the component from that one, and I do not want this lost:
{quote}For Declarative Pipelines, in principle you could skip some early {{stage}}'s and just start running on a later one, using {{FlowCopier}}.
{quote}
This would be instead of using a {{checkpoint}} step, and would not be dependent on Groovy internals. While it is less flexible in some respects, it is no less flexible than it _could_ be given the restrictions Declarative already imposes. This behavior would more closely match what you get from, say, the Build Pipeline plugin, but with the benefits of Jenkins Pipeline: stashes, exact SCM revisions, etc.

(Conversely, you could also offer the ability to run a build skipping some of the _later_ stages, somewhat analogously to running {{ant some-non-default-target}}.)

andrew.bayer@gmail.com (JIRA)

unread,
Jun 19, 2018, 11:11:21 AM6/19/18
to jenkinsc...@googlegroups.com
Andrew Bayer updated New Feature JENKINS-45455
 

Whoops, forgot to close this. Released in Declarative 1.3.

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

jbriden@cloudbees.com (JIRA)

unread,
Jun 19, 2018, 3:27:06 PM6/19/18
to jenkinsc...@googlegroups.com
Jenn Briden commented on New Feature JENKINS-45455
 
Re: Restarting stages

kutzi, this applies to the top-level stage, so it's irrelevant whether there are script blocks within a stage. If the format is syntactically correct declarative, then this will work for you.

We've added support in the declarative plugin. Blue Ocean support is now in development.

frank.genois@native-instruments.de (JIRA)

unread,
Jun 20, 2018, 4:30:05 AM6/20/18
to jenkinsc...@googlegroups.com
Frank Genois commented on New Feature JENKINS-45455
 
Re: Restarting stages

Hello, is there a plan to support restarting from sub-stages?

Let's say we have the following stages to build a multi-platform desktop application : 

 

Build-Win64 -> Test-Win64 -| 
Build-Win32 -> Test-Win32 -|-> Deploy
Build-MacOS -> Test-MacOS -|
Build-Linux -> Test-Linux -|

 

Where all the 'Build-XXX' are running in parallel within a global 'Build' stage. (The Build&Test stages could take quite a long time)

If let's say 'Build-Win32' fails for some unexpected environmental reasons, you do not want to rebuild the three other one. It would use unnecessary build server time. Same goes if 'Test-Win32' fails, you do not want to rebuild all the tests from the other platforms.

I'm sorry if there is already a way to do so, and if it is the case, could you provide me some guidance on how to achieve such a behavior?

rathore4u@gmail.com (JIRA)

unread,
Jun 20, 2018, 5:48:19 AM6/20/18
to jenkinsc...@googlegroups.com
Shantur Rathore commented on New Feature JENKINS-45455
 
Re: Restarting stages

Support for nested stages for parallel builds would be really cool. 

Most of the projects I work on do the heavy lifting in parallel stages and restart the failed part from parallel stage would be perfect.

afolgado@jccm.es (JIRA)

unread,
Jun 20, 2018, 8:58:04 AM6/20/18
to jenkinsc...@googlegroups.com
Andres Folgado commented on New Feature JENKINS-45455
 
Re: Restarting stages

Hi all,

In my project I use a Singleton-annotated class to store some variables across all stages.

This object is not preserved when restarting a stage, how can I accomplish this?

Thanks in advance.

afolgado@jccm.es (JIRA)

unread,
Jun 22, 2018, 7:15:06 AM6/22/18
to jenkinsc...@googlegroups.com
Hi all,

In my project I use a Singleton-annotated class to store some variables across all stages.


This object is not preserved when restarting a stage .

So
, my question is: how can I accomplish this persist some data during the execution so that I can get it later when restarting from a stage ?

Thanks in advance.

irc@webratz.de (JIRA)

unread,
Jun 29, 2018, 5:40:04 AM6/29/18
to jenkinsc...@googlegroups.com
Andreas Sieferlinger commented on New Feature JENKINS-45455
 
Re: Restarting stages

When restarting a stage, in the console the follwoing output is shown

Restarted from build #4, stage foobar

Is there any way to access this information within the restarted build? Eg via ENV variables or globals in the Jenkinsfile?

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

jbriden@cloudbees.com (JIRA)

unread,
Jul 2, 2018, 11:11:04 PM7/2/18
to jenkinsc...@googlegroups.com
Jenn Briden commented on New Feature JENKINS-45455
 
Re: Restarting stages

Frank Genois, the current design restarts at the top-level stage. Please open a separate ticket to request the ability to restart at a parallel stage. 

andrew.bayer@gmail.com (JIRA)

unread,
Jul 3, 2018, 9:47:03 AM7/3/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on New Feature JENKINS-45455
 
Re: Restarting stages

Andres Folgado - no, sorry - we don't preserve any Groovy state across restarts. If you need to preserve some data, you'd probably want to write it to a file, stash it, and then unstash it in the later stage. Make sure you have preserveStashes() (for the default of preserving the most recent build's stashes - pass a higher number as the argument if you need to preserve more) in the options block of your pipeline block or the stash will be cleared.

frank.genois@native-instruments.de (JIRA)

unread,
Jul 5, 2018, 8:33:03 AM7/5/18
to jenkinsc...@googlegroups.com
Frank Genois commented on New Feature JENKINS-45455
 
Re: Restarting stages

Regarding restarting from sub-stages, I created the following issue : https://issues.jenkins-ci.org/browse/JENKINS-52391

Please upvote if you are also looking forward to this feature.

 

badevcich@gmail.com (JIRA)

unread,
Jul 25, 2018, 9:29:03 AM7/25/18
to jenkinsc...@googlegroups.com
Blake Devcich commented on New Feature JENKINS-45455
 
Re: Restarting stages

Is there a way to always run a stage when restarting stages? Our pipeline requires a few things to be obtained dynamically in the beginning and when restarting stages we don't get that functionality.

Example:

Stage A -> Stage B -> Stage C -> Stage D

I want to restart Stage C or Stage D but I want to ensure that Stage A always runs first.

badevcich@gmail.com (JIRA)

unread,
Jul 25, 2018, 9:33:04 AM7/25/18
to jenkinsc...@googlegroups.com
Is there a way to always run a stage when restarting stages? Our pipeline requires a few things to be obtained dynamically in the beginning and when restarting stages we don't get that functionality.

I think something like a pre section (like post) would be really helpful here.

Example:

Stage A -> Stage B -> Stage C -> Stage D

I want to restart Stage C or Stage D but I want to ensure that Stage A always runs first.


 

jan.hoppe@heidelberg.com (JIRA)

unread,
Oct 25, 2018, 7:31:04 AM10/25/18
to jenkinsc...@googlegroups.com
Jan Hoppe commented on New Feature JENKINS-45455
 
Re: Restarting stages

I might be wrong, but I don't get how to switch off the restart stage option.

My pipelines currently don't work correctly after restarting a stage (I check out git only at first stage...)

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

andrew.bayer@gmail.com (JIRA)

unread,
Oct 25, 2018, 7:38:04 AM10/25/18
to jenkinsc...@googlegroups.com
Andrew Bayer commented on New Feature JENKINS-45455
 
Re: Restarting stages

There currently isn't a way to disable stage restart, but that's a good idea for us to add - could you create a new ticket for that? Thanks!

ben5556@gmail.com (JIRA)

unread,
Dec 5, 2018, 3:33:17 PM12/5/18
to jenkinsc...@googlegroups.com
Subbu K commented on New Feature JENKINS-45455
 
Re: Restarting stages

Blake Devcich I am looking for exactly what you asked. Have you figured out a way to achieve this ? Thanks!

j.spang@gmail.com (JIRA)

unread,
Dec 6, 2018, 11:41:08 PM12/6/18
to jenkinsc...@googlegroups.com
Jay Spang commented on New Feature JENKINS-45455
 
Re: Restarting stages

Jan Hoppe Andrew Bayer please update this thread if you created a ticket to disable stage restart. We desperately need this.

This feature does not work at all with my pipelines (it does not run on the same node as the original run), so it's generating false positives and wreaking havoc with my customers. I'm considering implementing some custom CSS to hide the silly thing before it causes us any more grief!

badevcich@gmail.com (JIRA)

unread,
Dec 7, 2018, 10:27:13 AM12/7/18
to jenkinsc...@googlegroups.com
Blake Devcich commented on New Feature JENKINS-45455
 
Re: Restarting stages

Subbu K - No, we haven't found a way around this, so we're not taking advantage of stage restarting. I have use boolean parameters which can be unchecked to skip stages - which works as a sort of poor mans stage restarting.

To expand on my previous example, I have check boxes as Job parameters for Stage B, C, D. I always want Stage A to run so there's no check box for that. If I want to restart Stage D, I uncheck the boxes for Stages B, C. Each stage in the pipeline checks the true/false value before running the stage.

It's not ideal, and it's not really taking advantage of this feature, but it works pretty well.

I also did create https://issues.jenkins-ci.org/browse/JENKINS-53167, so you might want to watch that.

varuag.chhabra@gmail.com (JIRA)

unread,
Jun 25, 2019, 8:06:04 AM6/25/19
to jenkinsc...@googlegroups.com
Gaurav Chhabra commented on New Feature JENKINS-45455
 
Re: Restarting stages

Blake Devcich: I have also voted for the ticket JENKINS-53167. For the workaround that you have in place, have you tied the job to a particular slave and use the same workspace each time the job runs? I am asking this because if a job ran the build and test phases successfully and then failed during packaging phase, how will you restart job and ensure that it picks up the already built binary for packaging phase.

 

I am also looking for running a particular phase each time (or may be having the option to run it whenever i want) irrespective of whichever phase i restart my job from. I have included my use case in your ticket JENKINS-53167

varuag.chhabra@gmail.com (JIRA)

unread,
Jun 25, 2019, 8:07:04 AM6/25/19
to jenkinsc...@googlegroups.com
Gaurav Chhabra edited a comment on New Feature JENKINS-45455
 
Re: Restarting stages
[~bdevcich]: I have also voted for the ticket  [ JENKINS-53167 |https://issues . jenkins-ci.org/browse/JENKINS-53167]. For the workaround that you have in place, have you tied the job to a particular slave and use the same workspace each time the job runs? I am asking this because if a job ran the build and test phases successfully and then failed during packaging phase, how will you restart job and ensure _ensure_ that it picks up the _already built binary_ for packaging phase.

 

I am also looking for running a particular phase each time (or may be having the option to run it whenever i want) irrespective of whichever phase i restart my job from. I have included my use case in your ticket 
[ JENKINS-53167 |https://issues.jenkins-ci.org/browse/JENKINS-53167]

badevcich@gmail.com (JIRA)

unread,
Jun 25, 2019, 9:20:04 AM6/25/19
to jenkinsc...@googlegroups.com
Blake Devcich commented on New Feature JENKINS-45455
 
Re: Restarting stages

Gaurav Chhabra: Yes, in this particular case, we have it tied to a slave for hardware dependency reasons.

 

varuag.chhabra@gmail.com (JIRA)

unread,
Jun 25, 2019, 11:26:15 AM6/25/19
to jenkinsc...@googlegroups.com
Gaurav Chhabra commented on New Feature JENKINS-45455
 
Re: Restarting stages

Thanks for the response Blake Devcich. Hardware dependency can definitely be one reason but will tying a job to a slave also ensure that subsequent builds will use the same workspace which was used by last failed build?

varuag.chhabra@gmail.com (JIRA)

unread,
Jun 27, 2019, 1:38:05 PM6/27/19
to jenkinsc...@googlegroups.com
Gaurav Chhabra updated an issue
Change By: Gaurav Chhabra
Comment: Thanks for the response [~bdevcich]. Hardware dependency can definitely be one reason but will tying a job to a slave also _ensure_ that subsequent builds will use the same workspace which was used by last failed build?
Reply all
Reply to author
Forward
0 new messages