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

Missing change history for perforce change, changelog.xml not properly escaping content

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.523, RHEL 5.5, Perforce plugin 1.3.24, All changes plugin 1.3, changes since last success plugin 0.5
    • Similar Issues:

      Description

      For some perforce changes, the changes is empty when it shouldn't be. The changelog.xml contains the data, but it doesn't show up in Jenkins. Upon close inspection, trying to parse the xml results in

      XMLSyntaxError: Sequence ']]>' not allowed in content, line 1492, column 31

      Looking at the changelog.xml, the '<' reserved xml character is properly replaced with its entity reference &lt, but the '>' reserved xml character is not replaced with its entity reference &gt.

      The solution to this would be as simple as finding where the text is being placed in the xml (PerforceChangeLogParser.java?) and escaping all the xml reserved characters.

      The impact of this bug is that changes with reserved xml characters in the description can cause the changelog.xml to be syntactically incorrect, and Jenkins to falsely show no changes.

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          We're using hudson.Util.xmlEscape during serialization (which is not in PerforceChangeLogParser, btw). Unfortunately, it appears to be extremely rudimentary, and only replaces '<' and '&'... We will need to replace it with something else. Note that this will NOT fix changelogs already written to disk, since this is not a problem with deserialization.

          Show
          rpetti Rob Petti added a comment - We're using hudson.Util.xmlEscape during serialization (which is not in PerforceChangeLogParser, btw). Unfortunately, it appears to be extremely rudimentary, and only replaces '<' and '&'... We will need to replace it with something else. Note that this will NOT fix changelogs already written to disk, since this is not a problem with deserialization.
          Hide
          cmayeux Caleb Mayeux added a comment -

          Oh, that's good information to know! I'm not concerned about fixing changelogs already written - once it's fixed it will be easy to write a quick parser that will go and fix the existing changelogs on disk.

          Show
          cmayeux Caleb Mayeux added a comment - Oh, that's good information to know! I'm not concerned about fixing changelogs already written - once it's fixed it will be easy to write a quick parser that will go and fix the existing changelogs on disk.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/hudson/plugins/perforce/PerforceChangeLogSet.java
          src/test/java/hudson/plugins/perforce/PerforceChangeLogParserTest.java
          http://jenkins-ci.org/commit/perforce-plugin/7c67b467cf8c2dd08794f20ec13d78dc9c472544
          Log:
          [FIXED JENKINS-19548] use commons-lang for properly escaping xml in changelog.xml files

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/hudson/plugins/perforce/PerforceChangeLogSet.java src/test/java/hudson/plugins/perforce/PerforceChangeLogParserTest.java http://jenkins-ci.org/commit/perforce-plugin/7c67b467cf8c2dd08794f20ec13d78dc9c472544 Log: [FIXED JENKINS-19548] use commons-lang for properly escaping xml in changelog.xml files

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              cmayeux Caleb Mayeux
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: