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

Template SCMs + Multiple SCMs results in failure parsing change log

XMLWordPrintable

      Using a configuration similar that outlined in the Environment field, Jenkins is unable to parse the changelog.xml file, because it results in a nested CDATA section. That is because Multiple-SCMs creates an XML structure similar to:

      <multi-scm-log>
        <sub-log scm="hudson.plugins.git.GitSCM">
          <![CDATA[Changes in origin/master ...
          ...
          ...]]>
        </sub-log>
        <sub-log scm="hudson.plugins.git.GitSCM">
        </sub-log>
      </multi-scm-log>
      

      That works fine for just the multiple-scm configuration. But when combined with the template-project "Use SCM from another project" option, the sub-log itself is completely wrapped in CDATA, thus resulting in an invalid XML document (it is invalid to nest CDATA sections):

      <multiple-scms>
        <sub-log scm="hudson.plugins.git.GitSCM">
          <![CDATA[Changes in origin/master, ...
          ...
          ...]]>
        </sub-log>
        <sub-log scm="hudson.plugins.templateproject.ProxySCM">
          <![CDATA[<multiple-scms>
            <sub-log scm="hudson.plugins.git.GitSCM">
              <![CDATA[Changes in projectA/master, ...
              ...
              ...]]>
            </sub-log>
            <sub-log scm="hudson.plugins.git.GitSCM">
              <![CDATA[Changes in projectB/master, ...
              ...
              ...]]>
            </sub-log>
          </multiple-scms>]]>
        </sub-log>
      </multiple-scms>
      

      As you can see, the GitSCM sub-log entries here are wrapped in CDATA, but the ProxySCM entry was already wrapped in CDATA.

      Ideally, CDATA should only be used if needed (e.g., in this case, the nodes could simply be nested, and only use CDATA around the actual commit data [from GitSCM]).

            kbell Kevin Bell
            jhansche Joe Hansche
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: