jenkinsci / jenkinsci/workflow-cps-plugin

[JENKINS-71178] Replay ignores pipeline flow

Open
#1,664 0 comments 0 reactions 0 assignees View on GitHub
component:pipeline component:workflow-cps-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
186
Forks
213
Avg merge
12h 12m
Merged PRs (30d)
8

Description

Assuming the following Jenkinsfile :

node { 

try {
def stepA = load(stepA.groovy)
stepA.call()
   def stepB = load(stepB.groovy)
stepB.call()
}catch(Exception e){
def handler = load(error.groovy)
handler.call()
}
}


 

If stepA throws an exception, Jenkins will execute stepA.groovy and error.groovy.

Then if I replay the job, jenkins will let me edit :



  • stepA.groovy as 'Script 1'

  • error.groovy as 'Script 2'

If stepA runs fine during the replay, Jenkins will override stepB.groovy with 'Script 2' (ie error.groovy).

Actual Behavior :

Edited scripts override the loaded script based on execution order.

Expected behavior :

Edited scripts should override the loaded scripts based on their paths.

 

---
Originally reported by nhurel, imported from: Replay ignores pipeline flow


  • status: Open
  • priority: Minor
  • component(s): pipeline, workflow-cps-plugin
  • label(s): blueocean
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-07

Raw content of original issue

Assuming the following Jenkinsfile :



node { 

try {
def stepA = load(stepA.groovy)
stepA.call()
   def stepB = load(stepB.groovy)
stepB.call()
}catch(Exception e){
def handler = load(error.groovy)
handler.call()
}
}



 

If stepA throws an exception, Jenkins will execute stepA.groovy and error.groovy.

Then if I replay the job, jenkins will let me edit :



  • stepA.groovy as 'Script 1'

  • error.groovy as 'Script 2'

If stepA runs fine during the replay, Jenkins will override stepB.groovy with 'Script 2' (ie error.groovy).

Actual Behavior :

Edited scripts override the loaded script based on execution order.

Expected behavior :

Edited scripts should override the loaded scripts based on their paths.

 

Contributor guide

Open the contributing guide

Research direction

Reproduce the Jenkinsfile scenario using stepA.groovy, stepB.groovy, and error.groovy, then inspect the workflow-cps-plugin replay handling. Compare how edited scripts are matched during replay when execution follows a different path. Done means replay edits apply to the loaded scripts by their paths rather than by execution order, with coverage for the described failure and replay flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, java
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.