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

Env-inject plugin suppress variables contributed by extension points

    XMLWordPrintable

    Details

    • Similar Issues:

      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

            Hide
            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

            Show
            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
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I hope to release the fix on this weekend

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

            the fix has been released in 2.1.4

            Show
            oleg_nenashev Oleg Nenashev added a comment - the fix has been released in 2.1.4
            Hide
            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)

            Show
            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)
            Hide
            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

            Show
            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

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

                Dates

                • Created:
                  Updated:
                  Resolved: