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

Newline characters in commit logs not parsed correctly

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: subversion-plugin
    • Labels:
      None
    • Environment:
      Master (Windows 7), Slaves (Windows 7, Ubuntu 14.04 LTS)
      Jenkins: 2.7.1 LTS
      Subversion plugin 2.6
    • Similar Issues:

      Description

      I have several jobs building via subversion commit triggers.
      The commit messages contain several lines with the majority in the following format:

      Commiter Name:
      Details of change1.
      Details of change2.
      

      Up to Jenkins version 1.651.1 + Subversion plugin 2.5.7, the build page displayed the commit message with several lines correctly under "change history".
      After upgrading to Jenkins 1.651.3 + Subversion plugin 2.6 and now Jenkins 2.7.1 + Subversion plugin 2.6, the commit message is displayed as a single line.
      For example, the commit message above would be displayed as follows:

      Commiter Name:<br>Details of change1.<br>Details of change2.
      

      Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

      &lt;br>
      

      As a result, the commit message is being displayed as a single line.

        Attachments

          Issue Links

            Activity

            chikigai chikigai created issue -
            chikigai chikigai made changes -
            Field Original Value New Value
            Description I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to 1.651.3 and now 2.7.1, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to 1.651.3 and now 2.7.1, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            Hide
            danielbeck Daniel Beck added a comment -

            After upgrading to 1.651.3

            Pretty sure this is irrelevant and misleading, as this appears to be a regression caused by Manuel Recena Soto in Subverson 2.6 in 86b8dabfa12c8ce3c38ac5e5756e73137770d173 – I think msgAnnotated in digest.jelly must now be printed raw, otherwise its be escaped.

            Show
            danielbeck Daniel Beck added a comment - After upgrading to 1.651.3 Pretty sure this is irrelevant and misleading, as this appears to be a regression caused by Manuel Recena Soto in Subverson 2.6 in 86b8dabfa12c8ce3c38ac5e5756e73137770d173 – I think msgAnnotated in digest.jelly must now be printed raw, otherwise its be escaped.
            danielbeck Daniel Beck made changes -
            Component/s core [ 15593 ]
            danielbeck Daniel Beck made changes -
            Assignee Manuel Recena Soto [ recena ]
            chikigai chikigai made changes -
            Description I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to 1.651.3 and now 2.7.1, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1 + Subversion plugin 2.5, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to 1.651.3 + Subversion plugin 2.6 and now 2.7.1, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            Hide
            chikigai chikigai added a comment -

            Thank you for pointing this out.
            I checked when I actually upgraded the Subversion plugin and found out it was together with the update to Jenkins 1.651.3.
            I've updated the details in the description accordingly.

            Show
            chikigai chikigai added a comment - Thank you for pointing this out. I checked when I actually upgraded the Subversion plugin and found out it was together with the update to Jenkins 1.651.3. I've updated the details in the description accordingly.
            chikigai chikigai made changes -
            Description I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1 + Subversion plugin 2.5, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to 1.651.3 + Subversion plugin 2.6 and now 2.7.1, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1 + Subversion plugin 2.5, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to Jenkins 1.651.3 + Subversion plugin 2.6 and now Jenkins 2.7.1 + Subversion plugin 2.6, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            chikigai chikigai made changes -
            Description I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1 + Subversion plugin 2.5, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to Jenkins 1.651.3 + Subversion plugin 2.6 and now Jenkins 2.7.1 + Subversion plugin 2.6, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            I have several jobs building via subversion commit triggers.
            The commit messages contain several lines with the majority in the following format:

            {code}
            Commiter Name:
            Details of change1.
            Details of change2.
            {code}
             
            Up to Jenkins version 1.651.1 + Subversion plugin 2.5.7, the build page displayed the commit message with several lines correctly under "change history".
            After upgrading to Jenkins 1.651.3 + Subversion plugin 2.6 and now Jenkins 2.7.1 + Subversion plugin 2.6, the commit message is displayed as a single line.
            For example, the commit message above would be displayed as follows:
            {code}
            Commiter Name:<br>Details of change1.<br>Details of change2.
            {code}

            Checking the html page source of the build page, it looks like the newline characters in the commit message are being generated as:

            {code:html}
            &lt;br>
            {code}

            As a result, the commit message is being displayed as a single line.
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 173234 ] JNJira + In-Review [ 185011 ]
            Hide
            kerrhome Shannon Kerr added a comment -

            Our teams are seeing this same issue. We use Trac+svn and typically our tickets in the form of #1234 are translated into a link to that ticket. When going from 2.5.7 to 2.6 of this plugin, our clickable links are now represented by the raw html and our nicely formatted revision changes list is no longer nicely formatted and more challenging to read around sometimes multiple <a>....</a> links throughout the list. I've taken our primary and sandbox Jenkins instances back to 2.5.7 for now. We're using 1.651 and 1642, but I also verified this in my private 2.19.1 instance.

            Show
            kerrhome Shannon Kerr added a comment - Our teams are seeing this same issue. We use Trac+svn and typically our tickets in the form of #1234 are translated into a link to that ticket. When going from 2.5.7 to 2.6 of this plugin, our clickable links are now represented by the raw html and our nicely formatted revision changes list is no longer nicely formatted and more challenging to read around sometimes multiple <a>....</a> links throughout the list. I've taken our primary and sandbox Jenkins instances back to 2.5.7 for now. We're using 1.651 and 1642, but I also verified this in my private 2.19.1 instance.
            Hide
            adityai Aditya Inapurapu added a comment -

            We found this issue on the latest Jenkins LTS 2.7.2 with the Subversion plugin 2.7-SNAPSHOT. We were able to resolve it by removing this line from the jelly script.

            <?jelly escape-by-default='true'?>

            Show
            adityai Aditya Inapurapu added a comment - We found this issue on the latest Jenkins LTS 2.7.2 with the Subversion plugin 2.7-SNAPSHOT. We were able to resolve it by removing this line from the jelly script. <?jelly escape-by-default='true'?>
            Hide
            danielbeck Daniel Beck added a comment -

            Manuel Recena Soto Did you abandon the SVN plugin?

            Show
            danielbeck Daniel Beck added a comment - Manuel Recena Soto Did you abandon the SVN plugin?
            Hide
            recena Manuel Recena Soto added a comment -
            Show
            recena Manuel Recena Soto added a comment - Daniel Beck No.
            Hide
            ljader Łukasz Jąder added a comment -

            Daniel Beck and Manuel Recena Soto and chikigai I've created a PR for this issue
            https://github.com/jenkinsci/subversion-plugin/pull/174

            (redmine link annotator in redmine-plugin is also affected by this issue)

            Show
            ljader Łukasz Jąder added a comment - Daniel Beck and Manuel Recena Soto and chikigai I've created a PR for this issue https://github.com/jenkinsci/subversion-plugin/pull/174 (redmine link annotator in redmine-plugin is also affected by this issue)
            Hide
            mjp Michael Paesold added a comment -

            Manuel Recena Soto please merge the pull request, it looks correct!

            Show
            mjp Michael Paesold added a comment - Manuel Recena Soto please merge the pull request, it looks correct!
            Hide
            invinity Matthew Pitts added a comment -

            Can we get this PR merged and released? This issue reduces the usability of Jenkins overall for projects that use SVN and multi-line commit messages as the changelog becomes virtually unreadable.

            Show
            invinity Matthew Pitts added a comment - Can we get this PR merged and released? This issue reduces the usability of Jenkins overall for projects that use SVN and multi-line commit messages as the changelog becomes virtually unreadable.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Lukasz Jader
            Path:
            src/main/resources/hudson/scm/SubversionChangeLogSet/digest.jelly
            src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly
            http://jenkins-ci.org/commit/subversion-plugin/4fe42befe197c81ee5d652e061f26b55017dbbfd
            Log:
            JENKINS-36521 Print raw (not HTML escaped) commit messages

            Commit decorators add clicable <a> links to issue IDs on build summary page,
            but the security mechanism preventing XSS in .jelly,
            escapes the HTML tags for .jelly files with:
            <?jelly escape-by-default='true'?>

            After the change, annotated commit messages are printed raw,
            without HTML escaping.

            Used method will be consistent with change in hudson/scm/SCM/project-changes.jelly
            introduced in https://github.com/jenkinsci/jenkins/commit/41ab84fe0a1512fe52347d55fb58445174636896

            Additional details:
            https://wiki.jenkins-ci.org/display/JENKINS/Jelly+and+XSS+prevention
            https://issues.jenkins-ci.org/browse/JENKINS-5135

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Lukasz Jader Path: src/main/resources/hudson/scm/SubversionChangeLogSet/digest.jelly src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly http://jenkins-ci.org/commit/subversion-plugin/4fe42befe197c81ee5d652e061f26b55017dbbfd Log: JENKINS-36521 Print raw (not HTML escaped) commit messages Commit decorators add clicable <a> links to issue IDs on build summary page, but the security mechanism preventing XSS in .jelly, escapes the HTML tags for .jelly files with: <?jelly escape-by-default='true'?> After the change, annotated commit messages are printed raw, without HTML escaping. Used method will be consistent with change in hudson/scm/SCM/project-changes.jelly introduced in https://github.com/jenkinsci/jenkins/commit/41ab84fe0a1512fe52347d55fb58445174636896 Additional details: https://wiki.jenkins-ci.org/display/JENKINS/Jelly+and+XSS+prevention https://issues.jenkins-ci.org/browse/JENKINS-5135
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Łukasz Jąder
            Path:
            src/main/resources/hudson/scm/SubversionChangeLogSet/digest.jelly
            src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly
            http://jenkins-ci.org/commit/subversion-plugin/8dc995bf09d1e51b365e4e7308fb40ea7f705f8b
            Log:
            Merge pull request #174 from ljader/fix-commit-message-escaping

            JENKINS-36521 Print raw (not HTML escaped) commit messages

            Compare: https://github.com/jenkinsci/subversion-plugin/compare/de82ef7a892e...8dc995bf09d1

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Łukasz Jąder Path: src/main/resources/hudson/scm/SubversionChangeLogSet/digest.jelly src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly http://jenkins-ci.org/commit/subversion-plugin/8dc995bf09d1e51b365e4e7308fb40ea7f705f8b Log: Merge pull request #174 from ljader/fix-commit-message-escaping JENKINS-36521 Print raw (not HTML escaped) commit messages Compare: https://github.com/jenkinsci/subversion-plugin/compare/de82ef7a892e...8dc995bf09d1
            reinholdfuereder Reinhold Füreder made changes -
            Hide
            reinholdfuereder Reinhold Füreder added a comment -

            Jesse Glick According to https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin this issue has been fixed and released in version 2.7.2 of the plugin on 7.3.2017.

            I like this fix/improvement, but there also seems to be a "Summary" section in old/classic UI's "Changes" section, that I think should also be adapted like this (if possible):

            • see
            • see "src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly", line 33
            Show
            reinholdfuereder Reinhold Füreder added a comment - Jesse Glick According to https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin this issue has been fixed and released in version 2.7.2 of the plugin on 7.3.2017. I like this fix/improvement, but there also seems to be a "Summary" section in old/classic UI's "Changes" section, that I think should also be adapted like this (if possible): see see "src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly", line 33
            Hide
            jglick Jesse Glick added a comment -

            Reinhold Füreder maybe that would be a follow-up issue. I do not know anything about. I am not pretending to maintain this plugin or examine arbitrary issue reports in it, much less trying to fix them.

            Show
            jglick Jesse Glick added a comment - Reinhold Füreder maybe that would be a follow-up issue. I do not know anything about. I am not pretending to maintain this plugin or examine arbitrary issue reports in it, much less trying to fix them.
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Assignee Manuel Recena Soto [ recena ] Łukasz Jąder [ ljader ]
            Resolution Fixed [ 1 ]
            Hide
            ljader Łukasz Jąder added a comment -

            Hi Reinhold Füreder,

            Honestly I'm with Jesse on having this reported as a separate issue.

            I've ran an initial analysis and I think parsing commit message should be implemented as in Git Plugin.
            The git-plugin checks if there is a blank 2nd line (commit message with format http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) and displays only this line on main job page and each build page,
            but it displays full commit message on "Changes" section (job/test-git-repo/4/changes).

            Just for reference, please checkout usage of "msgAnnotated" and "commentAnnotated" here:
            https://github.com/jenkinsci/git-plugin/blob/master/src/main/resources/hudson/plugins/git/GitChangeSetList/index.jelly

            Show
            ljader Łukasz Jąder added a comment - Hi Reinhold Füreder , Honestly I'm with Jesse on having this reported as a separate issue. I've ran an initial analysis and I think parsing commit message should be implemented as in Git Plugin. The git-plugin checks if there is a blank 2nd line (commit message with format http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) and displays only this line on main job page and each build page, but it displays full commit message on "Changes" section (job/test-git-repo/4/changes). Just for reference, please checkout usage of "msgAnnotated" and "commentAnnotated" here: https://github.com/jenkinsci/git-plugin/blob/master/src/main/resources/hudson/plugins/git/GitChangeSetList/index.jelly
            reinholdfuereder Reinhold Füreder made changes -
            Link This issue is related to JENKINS-42740 [ JENKINS-42740 ]
            Hide
            reinholdfuereder Reinhold Füreder added a comment -

            Thanks Jesse Glick and Łukasz Jąder: I have thus filed JENKINS-42740 – a minor improvement issue for that.

            Show
            reinholdfuereder Reinhold Füreder added a comment - Thanks  Jesse Glick and Łukasz Jąder : I have thus filed JENKINS-42740 – a minor improvement issue for that.

              People

              • Assignee:
                ljader Łukasz Jąder
                Reporter:
                chikigai chikigai
              • Votes:
                11 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: