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

Snippitizer should use double quotes around strings containing variables

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      In the example below, the user would expect ${WORKSPACE} to be substitutes for the workspace path. The snippitzer returns the parameter surrounded in single quotes so the replace does not happen. In this scenario, the snippitezer should return the parameter in double quotes and either convert the exiting double quotes to single, or properly escape them.

          [JENKINS-53026] Snippitizer should use double quotes around strings containing variables

          Jesse Glick added a comment -

          It could detect a parameter value which looks like it was meant to be a GString. Ultimately it is up to the author of the script to decide what was meant. For example, you rarely want to do Groovy-side interpolation of the script argument to sh (or bat or powershell), since it is safer and better to have the external process load that value as an environment variable.

          Jesse Glick added a comment - It could detect a parameter value which looks like it was meant to be a GString . Ultimately it is up to the author of the script to decide what was meant. For example, you rarely want to do Groovy-side interpolation of the script argument to sh (or bat or powershell ), since it is safer and better to have the external process load that value as an environment variable.

            Unassigned Unassigned
            mdkf Michael Fowler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: