Skip to content

[JENKINS-75307] Replay allows editing of scripts that have no effect #1700

@jenkins-infra-bot

Description

@jenkins-infra-bot

I replayed a piepline and it offered me 2 scripts to change.

I edited the second script but the subsequent build showed a blank diff and did not take the changes.

This was caused as the main pipeline was loading groovy from a file from the checkout and then calling `evaluate` on it.

Steps to reproduce

 

Create a Jenkinsfile in a repo with the following contents:

echo 'this is a test'
def s
node('built-in') {
 s = readFile('inner')
}
evaluate(s)

in the same repo create a file called inner with the following contents

echo 'Hello'

Create a pipeline job for the repo

perform a build of the job

replay the job and change the second script from echo 'hello' to echo 'Goodbye'

Expected Results

the replayed build contained "Goodbye"

or it should detect that the second script can not be eddited and only offer to edit the main pipeline (or anything that uses load and pipeline libraries.

Actual Results

The pipeline still contains "hello"

 


Originally reported by teilo, imported from: Replay allows editing of scripts that have no effect
  • status: Open
  • priority: Minor
  • component(s): workflow-cps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07
Raw content of original issue

I replayed a piepline and it offered me 2 scripts to change.

I edited the second script but the subsequent build showed a blank diff and did not take the changes.

This was caused as the main pipeline was loading groovy from a file from the checkout and then calling `evaluate` on it.

Steps to reproduce

 

Create a Jenkinsfile in a repo with the following contents:

echo 'this is a test'
def s
node('built-in') {
 s = readFile('inner')
}
evaluate(s)

in the same repo create a file called inner with the following contents

echo 'Hello'

Create a pipeline job for the repo

perform a build of the job

replay the job and change the second script from echo 'hello' to echo 'Goodbye'

Expected Results

the replayed build contained "Goodbye"

or it should detect that the second script can not be eddited and only offer to edit the main pipeline (or anything that uses load and pipeline libraries.

Actual Results

The pipeline still contains "hello"

 

environment
Jenkins 2.492.1<br/>
workflow-cps  4018.vf02e01888da_f<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions