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

Warn if there are comment strings in declarative pipeline when opened in editor

      I understand the BlueOcean Pipeline editor will rearrange Jenkinsfile contents as it sees fit, but where possible it should not result in data loss, this includes comments. One of the advantages of Pipeline as code over Jenkins Freestyle jobs is the ability to add helpful comments.

          [JENKINS-43005] Warn if there are comment strings in declarative pipeline when opened in editor

          Liam Newman created issue -
          Liam Newman made changes -
          Link New: This issue relates to JENKINS-43006 [ JENKINS-43006 ]
          James Dumay made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: blueocean-pipeline-editor-plugin [ 21828 ]

          James Dumay added a comment -

          bitwiseman a reasonable ask but I believe technically hard to do (ask abayer). Declarative has an API that exposes the Jenkinsfile model to us and allows us to roundtrip - this is a declarative ask.

          James Dumay added a comment - bitwiseman a reasonable ask but I believe technically hard to do (ask abayer ). Declarative has an API that exposes the Jenkinsfile model to us and allows us to roundtrip - this is a declarative ask.

          Andrew Bayer added a comment -

          See JENKINS-38864 - it's just not possible on the Declarative side. We don't have access to code comments in the parsing process, so we can't include them in any roundtripping from Jenkinsfile to JSON.

          Andrew Bayer added a comment - See  JENKINS-38864 - it's just not possible on the Declarative side. We don't have access to code comments in the parsing process, so we can't include them in any roundtripping from Jenkinsfile to JSON.

          Liam Newman added a comment -

          Then the editor needs to warn users that comments will be stripped if they are encountered.

          Liam Newman added a comment - Then the editor needs to warn users that comments will be stripped if they are encountered.
          R. Tyler Croy made changes -
          Link New: This issue is related to JENKINS-38864 [ JENKINS-38864 ]

          Michael Neale added a comment -

          If comments can't be round tripped, yes I think a warning - on load perhaps? 

          Michael Neale added a comment - If comments can't be round tripped, yes I think a warning - on load perhaps? 
          Michael Neale made changes -
          Summary Original: Support retaining/adding comments in BlueOcean Editor New: Warn if there are comment strings in declarative pipeline when opened in editor
          Andrew Bayer made changes -
          Component/s New: blueocean-pipeline-editor-plugin [ 21828 ]
          Component/s Original: pipeline-model-definition-plugin [ 21706 ]

            Unassigned Unassigned
            bitwiseman Liam Newman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: