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

Unable to override global envs after update to 2.1.4

    • 2.1.6

      We have a global setting of JIRA_URL=jira.acme.com

      In some jobs we override this in the "Prepare an environment for the run" section to JIRA_URL=jira-staging.acme.com

       

      After upgrading to 1.24 this stopped working. The effective value as seen in shell scripts is jira.acme.com

       

      Setting the value in a "Inject environment variables" build step also has no effect.

      The only thing that has an effect is to set the value inside the shell script.

          [JENKINS-47370] Unable to override global envs after update to 2.1.4

          Jakub Bochenski created issue -
          Jakub Bochenski made changes -
          Link New: This issue relates to JENKINS-47364 [ JENKINS-47364 ]
          Jakub Bochenski made changes -
          Labels New: regression

          arnaud dovi added a comment -

          Confirmed here, after reverting to 2.1.3 all the problems gone. 2.1.4 need more testing.

          arnaud dovi added a comment - Confirmed here, after reverting to 2.1.3 all the problems gone. 2.1.4 need more testing.
          arnaud dovi made changes -
          Priority Original: Critical [ 2 ] New: Blocker [ 1 ]

          Oleg Nenashev added a comment -

          Yes. Overrides is what has been fixed in 2.1.4

          Likely the behavior needs to be configurable, so that both 2.1.3 and 2.1.4 behaviors should be supported somehow.

           

          Oleg Nenashev added a comment - Yes. Overrides is what has been fixed in 2.1.4 Likely the behavior needs to be configurable, so that both 2.1.3 and 2.1.4 behaviors should be supported somehow.  

          oleg_nenashev you mean that not being able to override a global env is the intended behavior?

          Jakub Bochenski added a comment - oleg_nenashev you mean that not being able to override a global env is the intended behavior?

          arnaud dovi added a comment - - edited

          Btw the issue does not limits to overriding variable, it is the main feature of injecting a new variable in the build process that fails for me

          At least I verified with a few println() that the code is still executed, but anything placed in the hashmap is not saved properly

           

          def map...
          if (!binding.variables.containsKey('VAR1') || binding.variables.get('VAR1').equals("")) {
          map['VAR1'] = TOTO;
          }
          return map;
          

           

           

          2.1.3 => VAR1=TOTO if VAR1 is undefined (expected)

          2.1.4 => VAR1=null if VAR1 is undefined (not expected)

          arnaud dovi added a comment - - edited Btw the issue does not limits to overriding variable, it is the main feature of injecting a new variable in the build process that fails for me At least I verified with a few println() that the code is still executed, but anything placed in the hashmap is not saved properly   def map... if (!binding.variables.containsKey( 'VAR1' ) || binding.variables.get( 'VAR1' ).equals("")) { map[ 'VAR1' ] = TOTO; } return map;     2.1.3 => VAR1=TOTO if VAR1 is undefined (expected) 2.1.4 => VAR1=null if VAR1 is undefined (not expected)

          Oleg Nenashev added a comment -

          Created warning on Wiki: https://wiki.jenkins.io/display/JENKINS/EnvInject+Plugin 

          Probably I should depublish the release for now

          Oleg Nenashev added a comment - Created warning on Wiki: https://wiki.jenkins.io/display/JENKINS/EnvInject+Plugin   Probably I should depublish the release for now

          arnaud dovi added a comment -

          Yeah, I was looking for a way to lock the plugin to 2.1.3 and not being notified of newest updates of one plugin I guess it is not possible ? We use to update Jenkins always but have been forced to close connection to Jenkins update servers to not get the regression update. The downgrade button is nice with the plugin but I believe it misses a button like "Shutdown update notifications" per plugins

          arnaud dovi added a comment - Yeah, I was looking for a way to lock the plugin to 2.1.3 and not being notified of newest updates of one plugin I guess it is not possible ? We use to update Jenkins always but have been forced to close connection to Jenkins update servers to not get the regression update. The downgrade button is nice with the plugin but I believe it misses a button like "Shutdown update notifications" per plugins

            Unassigned Unassigned
            jbochenski Jakub Bochenski
            Votes:
            14 Vote for this issue
            Watchers:
            25 Start watching this issue

              Created:
              Updated:
              Resolved: