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

Env-inject plugin suppress variables contributed by extension points

    XMLWordPrintable

Details

    Description

      Whenever envvar is available on slave (either inherited from system or configured on slave), its value can not be overridden during build by envvar contributing extension points:

      • EnvironmentContributor
      • BuildWrapper
      • possibly others

      This works correctly when envinject is not installed. The culprit seemsto be that EnvInjectPluginAction retains all envvars (not only those envinject contributed) early in the build and put this values back as it implements EnvironmentContributingAction. Any value that was overridden by a plugin is then reset to its original value.

      Attachments

        Issue Links

          Activity

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java
            src/test/java/org/jenkinsci/plugins/envinject/BuildCauseRetrieverTest.java
            src/test/java/org/jenkinsci/plugins/envinject/EnvInjectActionTest.java
            http://jenkins-ci.org/commit/envinject-plugin/2948c711b05b68c6a94c334c26fe4e6fdcecda9f
            Log:
            [FIXED JENKINS-26583] Do not capture slave variables

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/org/jenkinsci/plugins/envinject/EnvInjectListener.java src/test/java/org/jenkinsci/plugins/envinject/BuildCauseRetrieverTest.java src/test/java/org/jenkinsci/plugins/envinject/EnvInjectActionTest.java http://jenkins-ci.org/commit/envinject-plugin/2948c711b05b68c6a94c334c26fe4e6fdcecda9f Log: [FIXED JENKINS-26583] Do not capture slave variables
            oleg_nenashev Oleg Nenashev added a comment -

            I hope to release the fix on this weekend

            oleg_nenashev Oleg Nenashev added a comment - I hope to release the fix on this weekend
            oleg_nenashev Oleg Nenashev added a comment -

            the fix has been released in 2.1.4

            oleg_nenashev Oleg Nenashev added a comment - the fix has been released in 2.1.4

            There is still an issue with plugin overriding env variables even if it is disabled (meaning not enabled in the project configuration). And PATH property still fully changed. I suggest to merge PATH property instead of overriding it (split both PATH's to elements and merge into Set)

            apxeolog Artyom Melnikov added a comment - There is still an issue with plugin overriding env variables even if it is disabled (meaning not enabled in the project configuration). And PATH property still fully changed. I suggest to merge PATH property instead of overriding it (split both PATH's to elements and merge into Set)
            oleg_nenashev Oleg Nenashev added a comment -

            > I suggest to merge PATH property instead of overriding it (split both PATH's to elements and merge into Set)

            I will be happy to review a pull request for that.
            It's not that trivial in the code though

            oleg_nenashev Oleg Nenashev added a comment - > I suggest to merge PATH property instead of overriding it (split both PATH's to elements and merge into Set) I will be happy to review a pull request for that. It's not that trivial in the code though

            People

              oleg_nenashev Oleg Nenashev
              olivergondza Oliver Gondža
              Votes:
              47 Vote for this issue
              Watchers:
              66 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: