[JIRA] (JENKINS-38818) String constants containing characters than need escaping are not round-tripped correctly

1 view
Skip to first unread message

stephenconnolly@java.net (JIRA)

unread,
Oct 7, 2016, 9:35:03 AM10/7/16
to jenkinsc...@googlegroups.com
stephenconnolly created an issue
 
Jenkins / Bug JENKINS-38818
String constants containing characters than need escaping are not round-tripped correctly
Issue Type: Bug Bug
Assignee: Andrew Bayer
Components: pipeline-model-definition-plugin
Created: 2016/Oct/07 1:34 PM
Priority: Minor Minor
Reporter: stephenconnolly

The following script cannot be round-tripped

Unable to find source-code formatter for language: groovy. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
pipeline {
    agent none
    stages {
        stage("foo") {
            echo '''Hello!
'How are you?', said script A

"I am fine \'\'\'really\'\'\'" said script B

'''
            sh 'echo "\'quoted\'"'
        }
    }
}
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

stephenconnolly@java.net (JIRA)

unread,
Oct 7, 2016, 9:41:01 AM10/7/16
to jenkinsc...@googlegroups.com

stephenconnolly@java.net (JIRA)

unread,
Oct 7, 2016, 9:41:04 AM10/7/16
to jenkinsc...@googlegroups.com
stephenconnolly started work on Bug JENKINS-38818
 
Change By: stephenconnolly
Status: Open In Progress

stephenconnolly@java.net (JIRA)

unread,
Oct 7, 2016, 9:42:05 AM10/7/16
to jenkinsc...@googlegroups.com
stephenconnolly commented on Bug JENKINS-38818
 
Re: String constants containing characters than need escaping are not round-tripped correctly

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

scm_issue_link@java.net (JIRA)

unread,
Oct 10, 2016, 4:02:02 AM10/10/16
to jenkinsc...@googlegroups.com

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

andrew.bayer@gmail.com (JIRA)

unread,
Oct 10, 2016, 7:41:03 AM10/10/16
to jenkinsc...@googlegroups.com

bitwiseman@gmail.com (JIRA)

unread,
Oct 22, 2019, 11:24:56 PM10/22/19
to jenkinsc...@googlegroups.com
Liam Newman closed an issue as Fixed
 

Bulk closing resolved issues.

Change By: Liam Newman
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages