jenkinsci / jenkinsci/workflow-cps-plugin

[JENKINS-41698] Unable to modify the order between scripts loaded during replay

Open
#1,271 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component:workflow-cps-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
186
Forks
212
Avg merge
12h 12m
Merged PRs (30d)
8

Description

Give an example directly. Main Script is like:
node("slave01") {
load "f1.groovy" // echo "1"
load "f2.groovy" // echo "2"
}
Modify the main script in Replay site, not the contents of Script1 or Script2
node("slave01") {
load "f2.groovy" // echo "2"
load "f1.groovy" // echo "1"
}
It actually run the loaded scripts' order - Script1 then Script2 ... so it still gets 1 and then 2 printed as result.


Originally reported by zhac, imported from: Unable to modify the order between scripts loaded during replay
  • status: Open
  • priority: Minor
  • component(s): workflow-cps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07
Raw content of original issue

Give an example directly. Main Script is like: node("slave01") { load "f1.groovy" // echo "1" load "f2.groovy" // echo "2" } Modify the main script in Replay site, not the contents of Script1 or Script2 node("slave01") { load "f2.groovy" // echo "2" load "f1.groovy" // echo "1" } It actually run the loaded scripts' order - Script1 then Script2 ... so it still gets 1 and then 2 printed as result.

  • environment: Jenkins v2.32.1 on Windows with pipeline plugin v2.4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the workflow-cps-plugin replay path and reproduce the example with two loaded Groovy scripts whose order is reversed in the replayed main script. The issue is resolved when replay executes the loaded scripts in the edited order rather than their original order.

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.