Release build wrapper does not allow multiple steps

Bug #1369597 reported by Dave Shawley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Triaged
Wishlist
Unassigned

Bug Description

A release build wrapper with multiple shell commands generates invalid XML. I have a patch (attached) but I am having trouble signing the contributor agreement to get a review started. There is also a branch available at https://github.com/dave-shawley/jenkins-job-builder/tree/fix-release-builder

The simplest example that I could come up with is:

---
- job:
    name: test
    wrappers:
      - release:
          post-success:
            - shell: first-command
            - shell: second-command

The current utility generates the following:

<?xml version="1.0" encoding="utf-8"?>
<project>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <concurrentBuild>false</concurrentBuild>
  <canRoam>true</canRoam>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <builders/>
  <publishers/>
  <buildWrappers>
    <hudson.plugins.release.ReleaseWrapper>
      <doNotKeepLog>false</doNotKeepLog>
      <overrideBuildParameters>false</overrideBuildParameters>
      <releaseVersionTemplate/>
      <postSuccessfulBuildSteps>
        <hudson.tasks.Shell>
          <command>first-command</command>
        </hudson.tasks.Shell>
      </postSuccessfulBuildSteps>
      <postSuccessfulBuildSteps>
        <hudson.tasks.Shell>
          <command>second-command</command>
        </hudson.tasks.Shell>
      </postSuccessfulBuildSteps>
    </hudson.plugins.release.ReleaseWrapper>
  </buildWrappers>
</project>

Note that multiple <postSuccessfulBuildSteps> elements are present. Jenkins does not support this and will 500 when the document is POSTed. The successful output should look like:

<?xml version="1.0" encoding="utf-8"?>
<project>
  <actions/>
  <description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
  <keepDependencies>false</keepDependencies>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <concurrentBuild>false</concurrentBuild>
  <canRoam>true</canRoam>
  <properties/>
  <scm class="hudson.scm.NullSCM"/>
  <builders/>
  <publishers/>
  <buildWrappers>
    <hudson.plugins.release.ReleaseWrapper>
      <doNotKeepLog>false</doNotKeepLog>
      <overrideBuildParameters>false</overrideBuildParameters>
      <releaseVersionTemplate/>
      <postSuccessfulBuildSteps>
        <hudson.tasks.Shell>
          <command>first-command</command>
        </hudson.tasks.Shell>
        <hudson.tasks.Shell>
          <command>second-command</command>
        </hudson.tasks.Shell>
      </postSuccessfulBuildSteps>
    </hudson.plugins.release.ReleaseWrapper>
  </buildWrappers>
</project>

Tags: jjb
Revision history for this message
Dave Shawley (daveshawley) wrote :
Revision history for this message
Jeremy Stanley (fungi) wrote :

Dave, I'd love to help you through the new contributor steps at https://wiki.openstack.org/wiki/How_To_Contribute#If_you.27re_a_developer so that you can have contributor credit toward this patch (and also so that we might abuse you toward fixing anything else you find wrong with JJB!). If you have a moment to pop into the #openstack-infra channel on the Freenode IRC network or explain here or in a post to the <email address hidden> mailing list, we're all more than happy to assist. Also, thanks for the bug report and patch!

tags: added: jjb
removed: jenkins
Changed in openstack-ci:
status: New → Triaged
importance: Undecided → Medium
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.