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

String constants containing characters than need escaping are not round-tripped correctly

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The following script cannot be round-tripped

      pipeline {
          agent none
          stages {
              stage("foo") {
                  echo '''Hello!
      'How are you?', said script A
      
      "I am fine \'\'\'really\'\'\'" said script B
      
      '''
                  sh 'echo "\'quoted\'"'
              }
          }
      }
      

        Attachments

          Issue Links

            Activity

            Hide
            stephenconnolly Stephen Connolly added a comment -

            May also want to handle round-tripping {{GString}}s but I'm too lazy to look up the escaping rules for those!

            Show
            stephenconnolly Stephen Connolly added a comment - May also want to handle round-tripping {{GString}}s but I'm too lazy to look up the escaping rules for those!
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.groovy
            src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.groovy
            src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java
            src/test/resources/json/stringsNeedingEscapeLogic.json
            src/test/resources/stringsNeedingEscapeLogic.groovy
            http://jenkins-ci.org/commit/pipeline-model-definition-plugin/506647b2725051adf55a95a9bd0893bde117250f
            Log:
            [FIXED JENKINS-38818] Correctly escape string constants when generating groovy from AST

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTPipelineDef.groovy src/main/groovy/org/jenkinsci/plugins/pipeline/modeldefinition/ast/ModelASTValue.groovy src/test/java/org/jenkinsci/plugins/pipeline/modeldefinition/AbstractModelDefTest.java src/test/resources/json/stringsNeedingEscapeLogic.json src/test/resources/stringsNeedingEscapeLogic.groovy http://jenkins-ci.org/commit/pipeline-model-definition-plugin/506647b2725051adf55a95a9bd0893bde117250f Log: [FIXED JENKINS-38818] Correctly escape string constants when generating groovy from AST

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                stephenconnolly Stephen Connolly
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: