-
Improvement
-
Resolution: Unresolved
-
Minor
-
-
Declarative backlog
On a restarted stage, there is a when condition, isRestartedRun() that can be used to run or not a stage. But there isn't anything that can be used to execute a bit different on a restart than in the original run. This leads to workarounds like:
stages {
stage('Schedule') {
when
}
agent any
steps
}
stage('Restart') {
when
agent any
steps
}
It would be much simpler and clearer to be able to just check for currentBuild.isRestartedRun wherever global variables are accessible
- depends on
-
JENKINS-41272 Pipeline "currentBuild" should expose build causes
-
- Resolved
-
- is related to
-
JENKINS-53662 isRestartedRun() is not reset after a successful stage
-
- In Review
-
- relates to
-
JENKINS-52774 Restart from Stage doesn't restore global variable
-
- Resolved
-
Due to the fun of plugin dependency trees, I can't actually add this to currentBuild, but I could definitely expose this either via a step (though I wouldn't want to call it isRestartedRun() to avoid confusion) or maybe a variable that gets added to the environment automatically. Lemme think on this.