Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When replaying a pipeline the code shown is the transformed declarative code rather than the original YAML #41

Open
ferrucciobongianni opened this issue Dec 30, 2020 · 4 comments

Comments

@ferrucciobongianni
Copy link

Describe the bug
I created a pipeline as YAML. Then ran it, so build n.1 completed. Clicked on the build, then hit the "replay" button, it showed the code of the pipeline, not as YAML anymore, but instead as its corresponding declarative code.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a simple "hello world" pipeline as YAML and save it.
  2. Build the pipeline, wait until build completes.
  3. Click on the build, then, click on "replay"
  4. See the code is not YAML anymore. Instead, it is the declarative version of the previous YAML code.

Expected behaviour
Replaying a build from a pipeline defined as YAML should show the original YAML code.

Example of YAML pipeline

pipeline:
  agent:
    label: 'master'
  stages:
   - stage: Setup
     steps: echo "hello world"

Declarative pipeline
When replaying the code of the pipeline above, this is shown

pipeline {
  agent {
    node {
      label 'master'
    }
  }
  stages {
    stage('Setup') {
      steps {
        echo "hello world"
      }
    }
  }
}
@aytuncbeken
Copy link
Contributor

Hi @ferrucciobongianni

Replay option comes from another plugin that shows the script which is run. As this pipeline converts yaml format into declarative and passes converted script, behavior of the Replay is true.

Another option can be to put "Replay with Yaml" link and show yaml content instead.

@ferrucciobongianni
Copy link
Author

Hi @aytuncbeken,
Yes I realised that when I looked at the code. I agree the replay plugin behaves correctly, although I guess - from the user prospective - the expectation would be to see in the replay text box exactly what their input was (which, in this case, would be the YAML definition).
I think having a "replay with Yaml" would be ok. It might feel slightly inconsistent with the configuration of the pipeline, but still better than not having the option to modify the YAML code when replaying.

@aytuncbeken
Copy link
Contributor

Agree, It is not the best option to have but at least something. I will work on this. Thanks for feedback!

@jonesbusy
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants