[JIRA] (JENKINS-60949) [EnvInject] Injecting properties of previous build breaks SCM polling

3 views
Skip to first unread message

sebastian.ratz@sap.com (JIRA)

unread,
Feb 3, 2020, 7:17:02 AM2/3/20
to jenkinsc...@googlegroups.com
Sebastian Ratz created an issue
 
Jenkins / Bug JENKINS-60949
[EnvInject] Injecting properties of previous build breaks SCM polling
Issue Type: Bug Bug
Assignee: Unassigned
Components: envinject-plugin
Created: 2020-02-03 12:16
Priority: Major Major
Reporter: Sebastian Ratz

The EnvInject plugin re-injects the environment of the previous build into the SCM poll for the next build.

However, it does this blindly, without considering when and where the previous build happened, and without knowing if the properties are actually applicable.

Scenario:

  1. Have 2 slaves (slave-linux, slave-windows)
  2. Configure job for SCM polling
  3. Build job for the first time -> runs on slave-linux**
  4. builds/1/injectedEnvVars.txt contains, for example, HOME=/home/jenkins
  5. **Wait for next SCM poll.
  6. SCM poll runs on slave-windows this time.
  7. EnvInject blindly takes the env vars from injectedEnvVars.txt from build 1 and injects it into the SCM polling process.
  8. SCM polling on Windows fails, e.g. with "Could not create directory '/home/jenkins/.ssh'." because of the wrong HOME environment variable.

Is there a way to prevent this? The job in question does not even make use of the EnvInject functionality, yet, injecting still happens at SCM polling time.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

sebastian.ratz@sap.com (JIRA)

unread,
Feb 3, 2020, 12:48:02 PM2/3/20
to jenkinsc...@googlegroups.com
Sebastian Ratz updated an issue
Change By: Sebastian Ratz
The EnvInject plugin re-injects the environment of the previous build into the SCM poll for the next build.

However, it does this blindly, without considering when and where the previous build happened, and without knowing if the properties are actually applicable.

Scenario:
# Have 2 slaves (*slave-linux*, *slave-windows*)
# Configure job for SCM polling
# Build job for the first time -> runs on *slave-linux*
**
# builds/1/injectedEnvVars.txt contains, for example, *HOME=/home/jenkins*
#
** Wait for next SCM poll.
# SCM poll runs on *slave-windows* this time.
# EnvInject blindly takes the env vars from injectedEnvVars.txt from build 1 and injects it into the SCM polling process.
# SCM polling on Windows fails, e.g. with "Could not create directory '/home/jenkins/.ssh'." because of the wrong *HOME* environment variable.


Is there a way to prevent this? The job in question does not even make use of the EnvInject functionality, yet, injecting still happens at SCM polling time.
Reply all
Reply to author
Forward
0 new messages