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

Provide a diagnostic if there are broken or malformed tokens in the email template

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Related to issues with JENKINS-18376, e.g.

      ${BLAH maxlines=250}
      

      should have been

      ${BLAH maxLines=250}
      

      but because of the parse error the entire email template was passed verbatim. A simple warning appended to the email to signify that there was an error with token substitution and providing the stack trace would make identification of the root cause much easier

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          Agreed, been trying to find a good way to do this.

          Show
          slide_o_mix Alex Earl added a comment - Agreed, been trying to find a good way to do this.
          Hide
          slide_o_mix Alex Earl added a comment -

          So, the whole rest of the email had no token replacements after the bad token, or the whole email even before the bad token?

          Show
          slide_o_mix Alex Earl added a comment - So, the whole rest of the email had no token replacements after the bad token, or the whole email even before the bad token?
          Hide
          stephenconnolly Stephen Connolly added a comment -

          I have asked our customer which it was they encountered.

          Show
          stephenconnolly Stephen Connolly added a comment - I have asked our customer which it was they encountered.
          Hide
          stephenconnolly Stephen Connolly added a comment -

          Attached is the job config of a job that reproduces the issue

          Show
          stephenconnolly Stephen Connolly added a comment - Attached is the job config of a job that reproduces the issue
          Hide
          slide_o_mix Alex Earl added a comment -

          Actually, I'm pretty sure from the code that it will not replace anything in the email text. I think in that case, I should just make the body be an error message, since it won't be useful for the email to have no replaced tokens anyway, what do you think?

          Show
          slide_o_mix Alex Earl added a comment - Actually, I'm pretty sure from the code that it will not replace anything in the email text. I think in that case, I should just make the body be an error message, since it won't be useful for the email to have no replaced tokens anyway, what do you think?
          Hide
          stephenconnolly Stephen Connolly added a comment -

          +1

          Show
          stephenconnolly Stephen Connolly added a comment - +1
          Hide
          slide_o_mix Alex Earl added a comment -

          Updated token-macro to return and error message if the parameters are incorrect. If a token is not found, it will be left alone and not replaced. This should be in token macro 1.8.1

          Show
          slide_o_mix Alex Earl added a comment - Updated token-macro to return and error message if the parameters are incorrect. If a token is not found, it will be left alone and not replaced. This should be in token macro 1.8.1

            People

            Assignee:
            slide_o_mix Alex Earl
            Reporter:
            stephenconnolly Stephen Connolly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: