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

$$ should emit a literal $ in token-macro and thus cloudfoundry

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      according to

      https://github.com/jenkinsci/token-macro-plugin/blob/master/src/main/java/org/jenkinsci/plugins/tokenmacro/Tokenizer.java#L72

      one might think that "$$FOO" expands to "$FOO" ( where $$ is a literal).
      … but it doesn't, at least not in the cloud foundry plugin.

      >ERROR: Could not parse token macro: Unrecognized macro 'FOO' in '$FOO'

      token macro 1.10, cloudfoundry 1.4.2 ( built from git)

        Attachments

          Activity

          Hide
          srl295 Steven Loomis added a comment - - edited

          Q, any updates on this? We are mystified at how to emit a literal $ - not sure if this is a token issue Alex Earl

          Show
          srl295 Steven Loomis added a comment - - edited Q, any updates on this? We are mystified at how to emit a literal $ - not sure if this is a token issue Alex Earl
          Hide
          williamg William Gautier added a comment -

          CF plugin dev here.

          It seems the "expandAll()" method of the token plugin will apply the escaping 3 times.
          https://github.com/jenkinsci/token-macro-plugin/blob/5835e5db5ecebeb39e0b2634d404bdca8ba6570b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java#L237-L242

          While waiting for a fix, you could work around it by triple escaping, using eight dollar signs.

          I'm going to remove the CF plugin from this bug's tags since this seems to be a token plugin bug.

          Show
          williamg William Gautier added a comment - CF plugin dev here. It seems the "expandAll()" method of the token plugin will apply the escaping 3 times. https://github.com/jenkinsci/token-macro-plugin/blob/5835e5db5ecebeb39e0b2634d404bdca8ba6570b/src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java#L237-L242 While waiting for a fix, you could work around it by triple escaping, using eight dollar signs. I'm going to remove the CF plugin from this bug's tags since this seems to be a token plugin bug.
          Hide
          srl295 Steven Loomis added a comment - - edited

          William Gautier That's a lot of dollar signs.. 2 3 .. this has got to be the best workaround ever, and a smile of the day.

          And more importantly, thanks for the investigation and reply.

          Show
          srl295 Steven Loomis added a comment - - edited William Gautier That's a lot of dollar signs.. 2 3 .. this has got to be the best workaround ever, and a smile of the day. And more importantly, thanks for the investigation and reply.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Alex Earl
          Path:
          src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java
          src/test/java/org/jenkinsci/plugins/tokenmacro/TokenMacroTest.java
          http://jenkins-ci.org/commit/token-macro-plugin/17a2d8352cff6d8e84efae1e3756ac8cfc806951
          Log:
          Fix JENKINS-29816

          Add extra $ automatically before calling the replaceMacro and environment variable expander.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Alex Earl Path: src/main/java/org/jenkinsci/plugins/tokenmacro/TokenMacro.java src/test/java/org/jenkinsci/plugins/tokenmacro/TokenMacroTest.java http://jenkins-ci.org/commit/token-macro-plugin/17a2d8352cff6d8e84efae1e3756ac8cfc806951 Log: Fix JENKINS-29816 Add extra $ automatically before calling the replaceMacro and environment variable expander.
          Hide
          slide_o_mix Alex Earl added a comment -

          Automatically add the additional $'s necessary before calling the replaceMacro and environment expander methods.

          Show
          slide_o_mix Alex Earl added a comment - Automatically add the additional $'s necessary before calling the replaceMacro and environment expander methods.

            People

            • Assignee:
              slide_o_mix Alex Earl
              Reporter:
              srl295 Steven Loomis
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: