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

Allow use of double quoted strings for pipeline variables

    • Blue Ocean - Candidates

      Problem
      For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

      In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

      It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

      Steps to reproduce

      • Use a notification step - try to get the pipeline name into the message string
      • Use an environment variable, try to use "credentials('abc')" to fetch the cred value (it will only be literally what you type in)

      Out of scope: 

      • A UI to select available pipeline variables

          [JENKINS-43951] Allow use of double quoted strings for pipeline variables

          Michael Neale created issue -
          Michael Neale made changes -
          Epic Link New: JENKINS-36291 [ 172300 ]

          Michael Neale added a comment -

          hey jamesdumay kzantow this actually came up for real. I am not sure if we ever had a solution for this (the model supports it, but how to we let the user choose or know it should be a double quoted string?)

          Michael Neale added a comment - hey jamesdumay kzantow this actually came up for real. I am not sure if we ever had a solution for this (the model supports it, but how to we let the user choose or know it should be a double quoted string?)

          Keith Zantow added a comment -

          We need a design for this, there isn't a way currently to specify literal (single quoted) or not... in theory this should apply to all inputs, adding a checkbox or something everywhere would not be ideal, though. Maybe there could be something shown on hover/focus for each input? Will leave that up to jamesdumay and brody

          Keith Zantow added a comment - We need a design for this, there isn't a way currently to specify literal (single quoted) or not... in theory this should apply to all inputs, adding a checkbox or something everywhere would not be ideal, though. Maybe there could be something shown on hover/focus for each input? Will leave that up to jamesdumay and brody

          Michael Neale added a comment -

          kzantow agree. Perhaps we need more - ie what variables are currently available in scope to help people out (that would be super nice, I would want to use that). 

          Michael Neale added a comment - kzantow agree. Perhaps we need more - ie what variables are currently available in scope to help people out (that would be super nice, I would want to use that). 
          James Dumay made changes -
          Description Original: For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 
          New:
          *Problem*
          For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

          *Steps to reproduce*
          TBD
          James Dumay made changes -
          Sprint New: Blue Ocean 1.2 [ 296 ]
          Description Original:
          *Problem*
          For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

          *Steps to reproduce*
          TBD
          New: *Problem*
          For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

          *Steps to reproduce*
          TBD

          James Dumay added a comment -

          We need to investigate making this transparent first before offering specialised UI to solve the issue.

          James Dumay added a comment - We need to investigate making this transparent first before offering specialised UI to solve the issue.
          Michael Neale made changes -
          Description Original: *Problem*
          For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

          *Steps to reproduce*
          TBD
          New: *Problem*
           For some steps, such as notifications, it is pretty common to want to be able to get to pipeline variables (as opposed to environment variables). 

          In pipeline text this generally means you use double quotes, and string interpolation in the parameters, howrever the editor uses single quotes and avoids groovy string expansion. 

          It would be nice to be able to allow dynamic double quoted strings as an option somehow. 

          *Steps to reproduce*
          * Use a notification step - try to get the pipeline name into the message string

          * Use an environment variable, try to use "credentials('abc')" to fetch the cred value (it will only be literally what you type in)

          Michael Neale added a comment -

          kzantow would it be possible to detect that they are using an expression that requires string interpolation, and assume it is double quoted when updating the model? (is that what the model "isLiteral" flag is for? or whatever it is called?) 

           

          This is particularly pertinent for environment variables, where you rarely want them to be some literal value anyway. 

          Michael Neale added a comment - kzantow would it be possible to detect that they are using an expression that requires string interpolation, and assume it is double quoted when updating the model? (is that what the model "isLiteral" flag is for? or whatever it is called?)    This is particularly pertinent for environment variables, where you rarely want them to be some literal value anyway. 

            Unassigned Unassigned
            michaelneale Michael Neale
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: