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

Newline characters in commit logs not parsed correctly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • subversion-plugin
    • None
    • Master (Windows 7), Slaves (Windows 7, Ubuntu 14.04 LTS)
      Jenkins: 2.7.1 LTS
      Subversion plugin 2.6

      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.

          [JENKINS-36521] Newline characters in commit logs not parsed correctly

          Manuel Recena Soto added a comment - danielbeck No.

          danielbeck and recena 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)

          Łukasz Jąder added a comment - danielbeck and recena 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)

          recena please merge the pull request, it looks correct!

          Michael Paesold added a comment - recena please merge the pull request, it looks correct!

          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.

          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.

          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

          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

          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

          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

          jglick 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

          Reinhold Füreder added a comment - jglick 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

          Jesse Glick added a comment -

          reinholdfuereder 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.

          Jesse Glick added a comment - reinholdfuereder 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.

          Hi reinholdfuereder,

          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

          Łukasz Jąder added a comment - Hi reinholdfuereder , 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

          Thanks jglick and ljader: I have thus filed JENKINS-42740 – a minor improvement issue for that.

          Reinhold Füreder added a comment - Thanks  jglick and ljader : I have thus filed JENKINS-42740 – a minor improvement issue for that.

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

              Created:
              Updated:
              Resolved: