jenkinsci / jenkinsci/workflow-cps-plugin
[JENKINS-53026] Snippitizer should use double quotes around strings containing variables
- Dominant language
- Java
- Stars
- 186
- Forks
- 213
- Avg merge
- 12h 12m
- Merged PRs (30d)
- 8
Description
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.

---
Originally reported by
mdkf, imported from: Snippitizer should use double quotes around strings containing variables
Raw content of original issue
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.
1 attachment
- [image-2018-08-13-21-02-59-197.png](https://issues.jenkins.io/secure/attachment/43731/image-2018-08-13-21-02-59-197.png)
> 
Contributor guide
Research direction
Start by locating the Snippitizer entry point in workflow-cps-plugin and reproduce the ${WORKSPACE} example described in the issue. Trace how strings containing variables are quoted, then add or update focused coverage for the expected output and handling of existing double quotes; done means the generated snippet allows the variable substitution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100