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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
      None
    • Environment:
      Windows Server 2008, Jenkins 1.456. List of plugins attached.
    • Similar Issues:

      Description

      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.

        Attachments

          Activity

          Hide
          gbois 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?

          Show
          gbois 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?
          Hide
          gabrielegiuseppini 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

          Show
          gabrielegiuseppini 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
          Hide
          gabrielegiuseppini Gabriele Giuseppini added a comment -

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

          Show
          gabrielegiuseppini Gabriele Giuseppini added a comment - (Anonymized) configuration file with EnvInject 1.0 and Jenkins 1.456.
          Hide
          gbois Gregory Boissinot added a comment -

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

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

          Do you need a config file with EnvInject 1.40?

          Show
          gabrielegiuseppini Gabriele Giuseppini added a comment - Do you need a config file with EnvInject 1.40?
          Hide
          scm_issue_link 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

          Show
          scm_issue_link 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
          Hide
          gbois 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

          Show
          gbois 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
          Hide
          gabrielegiuseppini Gabriele Giuseppini added a comment -

          Gregory,

          Thanks so much, 1.42 works like a charm!

          You have our eternal gratitude

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: