Quantcast

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
Issue Type: Bug Bug
Assignee: Gregory Boissinot
Attachments: config.xml
Components: envinject
Created: 16/Jul/12 12:30 AM
Description:

If you load a properties file as a build step, that overrides one or more build parameters, the injected variables will show up in the "Injected Environment Variables View", but the subsequent build steps will be provided with whatever was specified in the build parameter at the start of the build.

Consider the following:
Step 1 (generate the params.properties file)
cd sast_product
./waf configure
waf params

Here is the resulting file's contents:
SIM_REV = 81b806d6c4165277ad456a3ffd7ee2c5e0a9ed73
SIM_REMOTE_REV = d82501d4a73c200974138016f3b2628d0bbf0366
SIM_UI_REV = 2a0aef21282b1277f75555e9c68e4ace8deed055
FSW_CONTAINER_REV = 1e8d2005a045ac51219a1fd8915c7bd0f4f8a177
SIM_COMMON_REV = 6315defaf0c7376f2889bda3473828e2fbf2f743
SIM_INTERFACE_REV = 88c48d1349fb90cddbcaa1a21e93eee20cb15687
AST_REV = 8f947e56c1a6693687e8097fb50bba1626989ea6
WILLY_WONKA = harris

All but the last one map to build parameters. The last one is NOT a build parameter. Just a fake variable I added for test purposes.

Step 2 (Inject Environment variables)
Properties File Path: sast_product/build/params.properties
Console output:
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties file path 'sast_product/build/params.properties'
[EnvInject] - Variables injected successfully.

Step 3 (Execute shell and print the variables)
echo $SIM_COMMON_REV
echo $SIM_INTERFACE_REV
echo $WILLY_WONKA
Console output:
[sast_product_linux64] $ bash -xe /tmp/hudson6024044080448978568.sh
+ echo default
default
+ echo default
default
+ echo harris

You can see what's set in the environment are the build parameters ("default" is the default parameter value for SIM_COMMON_REV and SIM_INTERFACE_REV) and not the injected variables from the previous step. The dummy variable I added to the properties file that doesn't attempt to shadow a build parameter prints out OK.

I'm attaching the config.xml, but I'm hoping this description will suffice.

Project: Jenkins
Priority: Major Major
Reporter: Josh Davidson
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
Change By: Gregory Boissinot (04/Sep/12 4:17 PM)
Status: Open In Progress
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Please could you try to simplify your example?
I don't really understand.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
WH commented on Bug JENKINS-14437

Here's a more simple example:

Parameterized job with:

  • string parameter "_VERSION"
  • two builders:
    • Inject environment variables: Overwrites paramameter (environment variable) "_VERSION=xy"
    • Ant: Is called with property "version=${_VERSION}"

Actual result:
The value of the Ant property "version" is the original value of environment variable "_VERSION". It is not "xy"!

Expected result:
Value is "xy".

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
 
WH edited a comment on Bug JENKINS-14437

Here's a more simple example:

Parameterized job with:

  • string parameter "_VERSION"
  • two builders:
    • Inject environment variables: Overwrites paramameter (environment variable) "_VERSION=xy"
    • Execute shell: echo "value = $_VERSION"

Actual result:
The value of the the environment variable "_VERSION" is the orginal one. It is not "xy"!

Expected result:
The value is "xy".

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

I'm sorry for my late reply.
I reproduce the problem.
I'm investigating on it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Code changed in jenkins
User: Gregory Boissinot
Path:
src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildVariableContributor.java
http://jenkins-ci.org/commit/envinject-plugin/ed245ce8c7b4562159291a3599d6638e65301155
Log:
Fix JENKINS-14437 (Add a way to override build parameters)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org
Gregory Boissinot resolved Bug JENKINS-14437 as Fixed
Change By: Gregory Boissinot (27/Dec/12 6:40 PM)
Status: In Progress Resolved
Resolution: Fixed
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Hi Gregory, would the fix reflect in ver1.500. I have got this version but still I could reproduce this issue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[JIRA] (JENKINS-14437) envinject fails to "really" set/override build parameters

JIRA noreply@jenkins-ci.org
In reply to this post by JIRA noreply@jenkins-ci.org

Maybe a regression (The plugin is being to be complicated despite the add of unit tests).
Please check with a previous version and let me know.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Loading...