-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: envinject-plugin
-
Labels:None
-
Environment:Windows Server 2003 SP2
-
Similar Issues:
Variables are randomly getting unset or not resolved depending upon the name and length of the variable name itself.
This is broken in 0.15, but was working correctly in 0.14.
To reproduce:
1) Create a task and configure it
2) Add a "Inject Environment Variables" build step
3) Paste the following into the Properties Content section:
-----------------------------------------------------------------
A=value
B=${A}
ZIP=${B}
TIP=${B}
TZP=${B}
AIP=${B}
UIP=${B}_${UNSETVAR}
VIP=${B}_${UNSETVAR}
-----------------------------------------------------------------
4) Run the build
Result in the log:
----------------------------------------------------------------------
[EnvInject] - Injecting as environment variables the properties content
'A=value
B=${A}
ZIP=${B}
TIP=${B}
TZP=${B}
AIP=${B}
UIP=${B}_${UNSETVAR}
VIP=${B}_${UNSETVAR}'
[EnvInject] - Unset 'VIP' variable.
[EnvInject] - Unset 'TIP' variable.
[EnvInject] - Unset 'ZIP' variable.
----------------------------------------------------------------------
Problems:
1) ZIP and TIP get unset even though they are identical to TZP and AIP
2) UIP does not get unset, even though it has ${UNSETVAR} in it which cannot be resolved
Should consider changing unset feature to optional, as some variables need to have the $ symbol in them,
which will make it appear as unresolved.
Code changed in jenkins
User: Gregory Boissinot
Path:
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java
src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectActionSetter.java
src/main/java/org/jenkinsci/plugins/envinject/service/PropertiesService.java
src/main/java/org/jenkinsci/plugins/envinject/service/PropertiesVariablesRetriever.java
src/main/java/org/jenkinsci/plugins/envinject/util/SortedProperties.java
http://jenkins-ci.org/commit/envinject-plugin/0c98e3096c1d2f02a16f2ae00cffec5f344b0241
Log:
Fixed
JENKINS-11066