[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2019-10-22 Thread bitwise...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Liam Newman closed an issue as Not A Defect  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Bulk closing resolved issues.   
 

  
 
 
 
 

 
 Jenkins /  JENKINS-41455  
 
 
  Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
Change By: 
 Liam Newman  
 
 
Status: 
 Resolved Closed  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-issues/JIRA.178239.1485380214000.16221.1571801049458%40Atlassian.JIRA.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer resolved as Not A Defect  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-41455  
 
 
  Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
Change By: 
 Andrew Bayer  
 
 
Status: 
 Open Resolved  
 
 
Resolution: 
 Not A Defect  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Yeah, the only difference between single-quote and double-quote strings in Groovy is parse-time handling - i.e., whether to parse it as a String or a GString. So woot.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread kzan...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Keith Zantow commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Ah, perfect explanation. Functionally equivalent is fine by me.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Important point here - we have no way of telling the difference between 'hello' and "hello" - but then, it doesn't matter because they're not actually different. They're both just Strings. What matters is that we can distinguish between 'hello $WORLD' and "hello $WORLD", and that we do.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Double-checked it, and... 
 
sh 'echo "FOO is $FOO"' becomes 

 

{
  "name": "sh",
  "arguments": [  {
"key": "script",
"value": {
  "isLiteral": true,
  "value": "echo \"FOO is $FOO\""
}
  }]
},
 

 
 
 
echo "Foo is $FOO" becomes 

 

{
  "name": "echo",
  "arguments": [  {
"key": "message",
"value": {
  "isLiteral": false,
  "value": "Foo is $FOO"
}
  }]
}
 

 
  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

 

[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-26 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 So in this case, it should be isLiteral: true - parseArgument looks to see whether the _expression_ is a constant or GString. "hello" is a constant, 'echo $HELLO' is a constant, "echo $HELLO" is a GString. If it's a GString, isLiteral is set to false, otherwise it's set to true.   
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread kzan...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Keith Zantow edited a comment on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 No, it should be _isLiteral: false_. Although  it's  setting _isLiteral: false_ is  not going to be in the  editor  preview,  it probably will be eventually, and  when JSON -> Jenkinsfile is called, it should result in that argument being double quoted vs. single quoted. I dunno if that's an issue or not, but I should be able to load that, get the JSON with _isLiteral: false_ and then turn around and post it back with a similarly double-quoted result.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread kzan...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Keith Zantow commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 No, it should be isLiteral: false. Although it's not going to be in the preview, when JSON -> Jenkinsfile is called, it should result in that argument being double quoted vs. single quoted. I dunno if that's an issue or not, but I should be able to load that, get the JSON with isLiteral: false and then turn around and post it back with a similarly double-quoted result.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Ah. So in the case you included in the description, we should have "hello" inside double quotes in the model representation...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread kzan...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Keith Zantow commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 AFAIK it's the difference between double and single quotes in the pipeline script. So, for example: echo "hello $USER" might print 'hello jenkins' but echo 'hello $USER' might print 'hello apache', as the $USER variable will be resolved at runtime on the node, vs. runtime on the Jenkins server.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread andrew.ba...@gmail.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Andrew Bayer commented on  JENKINS-41455  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
 Not entirely sure what the problem is? Admittedly, I'm also still not entirely sure what "isLiteral" really means, so there's that. =)  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-41455) Converting double quoted values in scripts as 'isLiteral'

2017-01-25 Thread kzan...@cloudbees.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Keith Zantow created an issue  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
 Jenkins /  JENKINS-41455  
 
 
  Converting double quoted values in scripts as 'isLiteral'   
 

  
 
 
 
 

 
Issue Type: 
  Bug  
 
 
Assignee: 
 Andrew Bayer  
 
 
Components: 
 pipeline-model-definition-plugin  
 
 
Created: 
 2017/Jan/25 9:36 PM  
 
 
Priority: 
  Minor  
 
 
Reporter: 
 Keith Zantow  
 

  
 
 
 
 

 
 Given this pipeline: 

 

pipeline {
  agent any
  stages {
stage('Build') {
  steps {
echo "hello"
  }
}
  }
}
 

 Converting to JSON results in the script argument incorrectly labeled as isLiteral: true 

 

{"status":"ok","data":{"result":"success","json":{"pipeline":{"stages":[{"name":"Build","branches":[{"name":"default","steps":[{"name":"echo","arguments":[{"key":"message","value":{"isLiteral":true,"value":"hello"}}]}]}]}],"agent":{"type":"any"}