• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • core
    • Jenkins ver. 1.500

      The function hudson.Util.replaceMacro(String, ...) does not resolve properties with '.'
      E.g. many java properties or build parameters do/can have a dot in their names which cannot be expanded by this method which seems to be used by some plugins.
      Please add the dot to hudson.Util.VARIABLE pattern.

      Thx

          [JENKINS-16660] Environment variable replacement/resolving

          I've picked resolving this issue as an easy first contribution to Jenkins. First, I'd like to discuss backwards compatibility. Given these <key,value> mappings: <A,a>, <B,b> and <A.B,a-b>. How should $A.B and ${A.B} be evaluated? I think $A.B should evaluate to a.B, as it currently does, and ${A.B} to a-b instead of the current ${A.B}. With that scheme:

          1) References to keys with dots must use brackets.
          2) Existing ${A.B}-like references will break if there actually is an A.B key defined, which I think is very unlikely.

          Is this an acceptable resolution?

          Laurence North added a comment - I've picked resolving this issue as an easy first contribution to Jenkins. First, I'd like to discuss backwards compatibility. Given these <key,value> mappings: <A,a>, <B,b> and <A.B,a-b>. How should $A.B and ${A.B} be evaluated? I think $A.B should evaluate to a.B, as it currently does, and ${A.B} to a-b instead of the current ${A.B}. With that scheme: 1) References to keys with dots must use brackets. 2) Existing ${A.B}-like references will break if there actually is an A.B key defined, which I think is very unlikely. Is this an acceptable resolution?

          It is
          Thx

          Sven Appenrodt added a comment - It is Thx

          Code changed in jenkins
          User: Larry North
          Path:
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/3376cf01580ecd9cd099b5513874c8bed2490839
          Log:
          [FIXED JENKINS-16660] Allow variable names with dots in bracketed references.

          Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would
          evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the
          current ${A.B}.

          Existing ${A.B}-like references will break (not evaluate to ${A.B}) if
          there actually is an A.B variable defined, which I think is very
          unlikely.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Larry North Path: core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/3376cf01580ecd9cd099b5513874c8bed2490839 Log: [FIXED JENKINS-16660] Allow variable names with dots in bracketed references. Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the current ${A.B}. Existing ${A.B}-like references will break (not evaluate to ${A.B}) if there actually is an A.B variable defined, which I think is very unlikely.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #2758

          Result = SUCCESS

          dogfood added a comment - Integrated in jenkins_main_trunk #2758 Result = SUCCESS

          Code changed in jenkins
          User: Larry North
          Path:
          core/src/main/java/hudson/Util.java
          core/src/test/java/hudson/UtilTest.java
          http://jenkins-ci.org/commit/jenkins/f664639b79d2dea2abdf48816b01f8ccc525a73f
          Log:
          [FIXED JENKINS-16660] Allow variable names with dots in bracketed references.

          Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would
          evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the
          current ${A.B}.

          Existing ${A.B}-like references will break (not evaluate to ${A.B}) if
          there actually is an A.B variable defined, which I think is very
          unlikely.

          (cherry picked from commit 3376cf01580ecd9cd099b5513874c8bed2490839)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Larry North Path: core/src/main/java/hudson/Util.java core/src/test/java/hudson/UtilTest.java http://jenkins-ci.org/commit/jenkins/f664639b79d2dea2abdf48816b01f8ccc525a73f Log: [FIXED JENKINS-16660] Allow variable names with dots in bracketed references. Given these <variable,value> mappings: <A,a> and <A.B,a-b>, $A.B would evaluate to $a.B, as it currently does, and ${A.B} to a-b instead of the current ${A.B}. Existing ${A.B}-like references will break (not evaluate to ${A.B}) if there actually is an A.B variable defined, which I think is very unlikely. (cherry picked from commit 3376cf01580ecd9cd099b5513874c8bed2490839)

            lnorth Laurence North
            zioschild Sven Appenrodt
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: