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

Multi-line JOB_DESCRIPTION in subject blows up

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: token-macro-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.634, email-ext 2.40.5
    • Similar Issues:

      Description

      Multi-line JOB_DESCRIPTION causes the newlines to be inserted into the subject. That then causes the receiving mail client to display the rest of the headers as part of the message, e.g.:

      TODO: Expand.
      Are there HDL ones? - Still Failing!
      MIME-Version: 1.0
      Content-Type: multipart/mixed;
              boundary="----=_Part_3_637129346.1449769940205"
      X-Jenkins-Job: Pretty name of job
      X-Jenkins-Result: FAILURE
      Precedence: bulk
      
      ------=_Part_3_637129346.1449769940205
      Content-Type: text/plain; charset=UTF-8
      Content-Transfer-Encoding: 7bit
      

        Attachments

          Issue Links

            Activity

            Hide
            slide_o_mix Alex Earl added a comment -

            This token is being moved to the token-macro plugin so I reassigned it there. Adding a removeNewlines parameter that will replace the newlines with a space.

            Show
            slide_o_mix Alex Earl added a comment - This token is being moved to the token-macro plugin so I reassigned it there. Adding a removeNewlines parameter that will replace the newlines with a space.
            Hide
            aarondmarasco_vsi Aaron D. Marasco added a comment -

            I was thinking something like that, or maybe a special case of just stopping at the first newline if you're in a subject. A multiline would probably be fine in the body.

            Show
            aarondmarasco_vsi Aaron D. Marasco added a comment - I was thinking something like that, or maybe a special case of just stopping at the first newline if you're in a subject. A multiline would probably be fine in the body.
            Hide
            slide_o_mix Alex Earl added a comment -

            That's the problem, the macro has no idea where it is being used, so it can't just detect if its being used in a subject or not. The parameter will be added in the next release of the token-macro plugin.

            Show
            slide_o_mix Alex Earl added a comment - That's the problem, the macro has no idea where it is being used, so it can't just detect if its being used in a subject or not. The parameter will be added in the next release of the token-macro plugin.
            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/impl/JobDescriptionMacro.java
            src/test/java/org/jenkinsci/plugins/tokenmacro/impl/JobDescriptionMacroTest.java
            http://jenkins-ci.org/commit/token-macro-plugin/22a5aa7db05011d06348620f02ca0b0e5473a5cd
            Log:
            Fix JENKINS-32012

            Add removeNewlines parameter.
            Fix issue when job description is not set (null)

            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/impl/JobDescriptionMacro.java src/test/java/org/jenkinsci/plugins/tokenmacro/impl/JobDescriptionMacroTest.java http://jenkins-ci.org/commit/token-macro-plugin/22a5aa7db05011d06348620f02ca0b0e5473a5cd Log: Fix JENKINS-32012 Add removeNewlines parameter. Fix issue when job description is not set (null)
            Hide
            slide_o_mix Alex Earl added a comment -

            Will be in token-macro-1.12

            Show
            slide_o_mix Alex Earl added a comment - Will be in token-macro-1.12

              People

              • Assignee:
                slide_o_mix Alex Earl
                Reporter:
                aarondmarasco_vsi Aaron D. Marasco
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: