Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-75307

Replay allows editing of scripts that have no effect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None
    • Jenkins 2.492.1
      workflow-cps 4018.vf02e01888da_f
                              

      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"

       

            Unassigned Unassigned
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: