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

EnvInject 1.40 does not resolve anymore environment variables in values of environment variables

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • envinject-plugin
    • None
    • Windows Server 2008, Jenkins 1.456. List of plugins attached.

      Most of our jobs had EnvInject variables like the following:
      DATABASE_NAME=JenkinsFooBar${SVN_REVISION}

      These were happily resolved until we upgraded EnvInject from 1.00 to 1.40, and Jenkins itself from 1.435 to 1.456. After the upgrade, EnvInject logs an error saying that variable DATABASE_NAME is unresolved.

          [JENKINS-13183] EnvInject 1.40 does not resolve anymore environment variables in values of environment variables

          Gregory Boissinot added a comment - - edited

          EnvInject seems to not capture the SVN_REVISION variable.
          I'll try to reproduce it.
          Could you attach your job configuration file?

          Gregory Boissinot added a comment - - edited EnvInject seems to not capture the SVN_REVISION variable. I'll try to reproduce it. Could you attach your job configuration file?

          Gabriele Giuseppini added a comment - - edited

          Configuration attached (I've anonymized sensitive information).

          Please note that this is the config with EnvInject 1.0 and Jenkins 1.456 (i.e. the configuration that resolves the variable). Here's an excerpt from the log that shows the variable being successfully injected:

          [EnvInject] - Injecting as environment variables the properties content
          CIDBName=Jenkins226253

          If I now upgrade to EnvInject 1.40, the log says something along the lines of "not injecting unresolved variable". Note that during upgrade/downgrade I lose the EnvInject step for 100+ jobs, so I'd rather try to avoid going through the repro unless you really need me to

          Gabriele Giuseppini added a comment - - edited Configuration attached (I've anonymized sensitive information). Please note that this is the config with EnvInject 1.0 and Jenkins 1.456 (i.e. the configuration that resolves the variable). Here's an excerpt from the log that shows the variable being successfully injected: [EnvInject] - Injecting as environment variables the properties content CIDBName=Jenkins226253 If I now upgrade to EnvInject 1.40, the log says something along the lines of "not injecting unresolved variable". Note that during upgrade/downgrade I lose the EnvInject step for 100+ jobs, so I'd rather try to avoid going through the repro unless you really need me to

          (Anonymized) configuration file with EnvInject 1.0 and Jenkins 1.456.

          Gabriele Giuseppini added a comment - (Anonymized) configuration file with EnvInject 1.0 and Jenkins 1.456.

          Upgrade a plugin should keep backward compatibility.
          However, downgrade is never guarantee (moreover from 1.0 to 1.40)

          Gregory Boissinot added a comment - Upgrade a plugin should keep backward compatibility. However, downgrade is never guarantee (moreover from 1.0 to 1.40)

          Do you need a config file with EnvInject 1.40?

          Gabriele Giuseppini added a comment - Do you need a config file with EnvInject 1.40?

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapper.java
          src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuilder.java
          http://jenkins-ci.org/commit/envinject-plugin/557267f02ea1ef05be9b04880a97984896741255
          Log:
          Fix JENKINS-13183

          Compare: https://github.com/jenkinsci/envinject-plugin/compare/a37384c...557267f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuildWrapper.java src/main/java/org/jenkinsci/plugins/envinject/EnvInjectBuilder.java http://jenkins-ci.org/commit/envinject-plugin/557267f02ea1ef05be9b04880a97984896741255 Log: Fix JENKINS-13183 Compare: https://github.com/jenkinsci/envinject-plugin/compare/a37384c...557267f

          Could you test the fix with EnvInject 1.42?
          Do not hesitate to reopen the issue with your comments if this new version doesn't fix the issue in your context.
          Thanks

          Gregory Boissinot added a comment - Could you test the fix with EnvInject 1.42? Do not hesitate to reopen the issue with your comments if this new version doesn't fix the issue in your context. Thanks

          Gregory,

          Thanks so much, 1.42 works like a charm!

          You have our eternal gratitude

          Gabriele Giuseppini added a comment - Gregory, Thanks so much, 1.42 works like a charm! You have our eternal gratitude

            gbois Gregory Boissinot
            gabrielegiuseppini Gabriele Giuseppini
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: