Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12841

EnvInject Plugin 1.26 does not substitute ${WORKSPACE} correctly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • envinject-plugin
    • None

      This problem appeared when I upgraded the EnvInject Plugin from 1.25 to 1.26, so the problem was probably introduced with the fix for JENKINS-12704.

      I have a job with "Inject environment variables to the build process" selected, and the following line in "Properties Content":
      materialize_workspace_path=${WORKSPACE}/materialize_workspace

      In 1.25, this environment variable was correctly given the value
      /scratch/jenkins_workspace/GDA_master.tests.RH5_64/materialize_workspace

      In 1.26, this environment variable was WRONGLY given the value
      /scratch/jenkins_slave//scratch/jenkins_workspace/GDA_master.tests.RH5_64/materialize_workspace

          [JENKINS-12841] EnvInject Plugin 1.26 does not substitute ${WORKSPACE} correctly

          The job with the problem ran on a slave. It has a custom workspace.

          Matthew Webber added a comment - The job with the problem ran on a slave. It has a custom workspace.

          I can't reproduce.
          Could you check again the problem persists?

          And could you attach your job conifguration file (config.xml in $JENKINS_HOME/jobs/<your_job>)?

          Gregory Boissinot added a comment - I can't reproduce. Could you check again the problem persists? And could you attach your job conifguration file (config.xml in $JENKINS_HOME/jobs/<your_job>)?

          Uploaded config.xml for the job that had the problem

          Matthew Webber added a comment - Uploaded config.xml for the job that had the problem

          >> Could you check again the problem persists?

          Let me know if you still need this. I don't have a suitable test Jenkins environment to do this in, so although I can do it if really necessary, it will be somewhat disruptive, so I'm somewhat reluctant.

          If it helps, I'm quite sure that the problem was introduced in 1.26.

          Matthew Webber added a comment - >> Could you check again the problem persists? Let me know if you still need this. I don't have a suitable test Jenkins environment to do this in, so although I can do it if really necessary, it will be somewhat disruptive, so I'm somewhat reluctant. If it helps, I'm quite sure that the problem was introduced in 1.26.

          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/EnvInjectVariableGetter.java
          http://jenkins-ci.org/commit/envinject-plugin/b2c132e077b2bb052df175660a8906533d681d37
          Log:
          Fix JENKINS-12704 and JENKINS-12841

          Compare: https://github.com/jenkinsci/envinject-plugin/compare/6ff47b2...b2c132e

          SCM/JIRA link daemon added a comment - 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/EnvInjectVariableGetter.java http://jenkins-ci.org/commit/envinject-plugin/b2c132e077b2bb052df175660a8906533d681d37 Log: Fix JENKINS-12704 and JENKINS-12841 Compare: https://github.com/jenkinsci/envinject-plugin/compare/6ff47b2...b2c132e

          Could you test with envinject 1.28?

          Gregory Boissinot added a comment - Could you test with envinject 1.28?

          The problem is fixed in 1.28 - thanks for your prompt attention.
          Should a test be added for this case - we've had a couple of releases lately which have broken stuff.

          Matthew Webber added a comment - The problem is fixed in 1.28 - thanks for your prompt attention. Should a test be added for this case - we've had a couple of releases lately which have broken stuff.

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java
          http://jenkins-ci.org/commit/envinject-plugin/eb3cb491dcede8409b26bc8fe3cfc1e0af99b1d9
          Log:
          Add an integration test to fix JENKINS-12841

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java http://jenkins-ci.org/commit/envinject-plugin/eb3cb491dcede8409b26bc8fe3cfc1e0af99b1d9 Log: Add an integration test to fix JENKINS-12841

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java
          http://jenkins-ci.org/commit/envinject-plugin/6fd8c4018572af8c7154cab49c7552da831f96f1
          Log:
          Add an integration test to fix JENKINS-12841

          Compare: https://github.com/jenkinsci/envinject-plugin/compare/db8e61f...6fd8c40

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/test/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapperTest.java http://jenkins-ci.org/commit/envinject-plugin/6fd8c4018572af8c7154cab49c7552da831f96f1 Log: Add an integration test to fix JENKINS-12841 Compare: https://github.com/jenkinsci/envinject-plugin/compare/db8e61f...6fd8c40

          Test added

          Gregory Boissinot added a comment - Test added

            gbois Gregory Boissinot
            mwebber Matthew Webber
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: