Issue Type: Bug Bug
Assignee: Kevin Bell
Components: multiple-scms, template-project
Created: 23/Jul/12 6:21 PM
Description:

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]).

Environment: * Template1:
** Multiple SCMs:
*** Git[subprojectA]: git://server/subprojectA.git
*** Git[subprojectB]: git://server/subprojectB.git
* ProjectJob:
** Multiple SCMs:
*** Use SCM from another job: Template1
*** Git[project]: git://server/project.git
Project: Jenkins
Priority: Major Major
Reporter: Joe Hansche
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to