jenkinsci / jenkinsci/workflow-cps-plugin

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

Open
#1,471 1 comment 0 reactions 0 assignees View on GitHub
component:workflow-cps-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
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


  • status: Open
  • priority: Minor
  • component(s): workflow-cps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-07

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)
> ![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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.