Issue Details (XML | Word | Printable)

Key: HUDSON-6004
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: mindless
Reporter: sorokh
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hudson

Windows paths are no longer correctly passed in the parameters

Created: 20/Mar/10 11:34 PM   Updated: 29/Jul/10 02:15 PM   Resolved: 29/Jul/10 02:15 PM
Return to search
Component/s: parameterized-trigger
Affects Version/s: current
Fix Version/s: current

Environment: windows 2003 server


 Description  « Hide

When upgrading form the 1.x to the latest 2.x version we noticed that now the backslash characters are interpreted as special characters in the passed parameter value.
We used to pass our workspace as parameter to the different jobs and now this path gets mangled, so we had to revert the upgrade. Apparently somewhere logic got added to do an interpretation of the value being passed as parameter.
Could this behaviour be fixed or at least be made so that one can choose if the expansion needs to happen or not.



Sort Order: Ascending order - Click to sort in descending order
mindless added a comment - 29/Jul/10 12:14 PM

Looking into this.. I think it's a side-effect of allowing $OTHER_PARAM references in the parameters text. Expansion of these variables is affecting the backslashes (presumably so you could put \$OTHER_PARAM to avoid parameter expansion and get literal text $OTHER_PARAM).


mindless added a comment - 29/Jul/10 12:27 PM

No, on further checking the Hudson EnvVars class uses $$ to avoid expansion, not \$. It is reading the text as java Properties format that is doing stuff with backslashes.


mindless added a comment - 29/Jul/10 01:51 PM

The content here in a "Predefined parameters" entry is specified to be in Java properties format, so I don't think we can do anything about the handling of backslashes. I will add a note about backslashes in the help text for that field.


scm_issue_link added a comment - 29/Jul/10 02:15 PM

Code changed in hudson
User: : mindless
Path:
trunk/hudson/plugins/parameterized-trigger/src/main/java/hudson/plugins/parameterizedtrigger/PredefinedBuildParameters.java
trunk/hudson/plugins/parameterized-trigger/src/main/webapp/help/properties.html
http://hudson-ci.org/commit/33342
Log:
[parameterized-trigger] [FIXED HUDSON-6004] Expand parameter references in
"Predefined parameters" on a value-by-value basis AFTER reading the text in
java properties format, to avoid mangling of values containing backslashes.
This means putting $FOO in the text where FOO is "ABC=123\nDEF=456" will
no longer expand into separate ABC and DEF parameter to pass along.
However, it fixes a case like MYWS=$WORKSPACE on windows, as the backslash
characters in the path will no longer be lost.
Also added a note in the help text for this field about backslashes.