The Source for Java Technology Collaboration
User: Password:



Kohsuke Kawaguchi

Kohsuke Kawaguchi's Blog

Hudson/JIRA integration

Posted by kohsuke on March 12, 2007 at 05:30 PM | Comments (10)

Apache Lucene project is now apparently using Hudson for their nightly builds. While looking at how they are doing, I noticed that one of them suggested using Bamboo because of a nicer JIRA and Confluence integration.

So I decided to write a Hudson plugin for JIRA. It's famous enough, so I figured there are probably more Hudson users who'd enjoy such a plugin. JIRA has a SOAP interface, so it was relatively easy to talk to it from Hudson.

First, you need to go to Hudson's system config screen to tell Hudson where's your JIRA. This plugin has an optional feature to update JIRA issues with a back pointer to Hudson build pages. This allows the submitter and watchers to quickly find out which build they need to pick up to get the fix. If you also want to use this feature, you need to supply a valid user id/password.

systemConfig.png

JIRA also needs to be configured for Hudson to remotely login. Go to the general configuration screen and enable remote API calls. Again, this is only needed if you use the abovementioned optional feature, and if you forget to do so, Hudson will nicely warn you.

jiraConfig.PNG

With that, JIRA keys in changelogs are now hyperlinked to the corresponding JIRA pages (complete with tooltips!)

jiraLink.PNG

To have Hudson update JIRA issues with back pointers to builds, you also need to configure jobs. I figured you might not always have write access to the JIRA (say you have a Hudson build for one of the Apache commons project that you depend on), so that's why this is optional.

jobConfig.png

And the following screen shows how JIRA issue is updated.

jiraIssue.png

By taking advantages of Hudson's fingerprint feature, when your other projects that depend on this project picks up a build with a fix, those build numbers can be also recorded to JIRA. This is quite handy when a bug is fixed in one of the libraries, yet the submitter wants a fix in a different project. This happens often in my work, where a bug is reported against JAX-WS but the fix is in JAXB.

This plugin can be downloaded from Hudson website, and it works with the latest Hudson 1.86. If you have ideas about how to improve this plugin, plase submit RFEs (or better yet, join us as a developer.)


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Nice plugin Kohsuke! I upgraded AppFuse's Hudson Server to 1.86 and installed this plugin. Seems to work flawlessly. Now how about a Fisheye Plugin? ;-)

    Posted by: mraible on March 12, 2007 at 09:48 PM


  • Your wish is my command. That is one of the oldest RFE, and I've been asked by many folks to do so, so stay tuned.


    The only thing is that, I was hoping to see more people writing plugins for Hudson, yet that's just not happening. I'm wondering what I can do better to get more people signed up for writing plugins like this.

    Posted by: kohsuke on March 12, 2007 at 09:58 PM

  • Perhaps people see that you're so prolific at writing the plugins, so they just patiently wait... :)

    Posted by: kirillcool on March 12, 2007 at 11:22 PM

  • I don't know about others, but for me, I didn't write the plugin yet because most of my time I just read source code notifications from you, Kohsuke. :) You produce bugfixes faster then I can read, I swear it. :)

    On a more serious note, it seems that you could write FishEye plugin within a day or so, while for others that would be weeks. So we just wait...
    P.S. I do think that FishEye plugin could be pretty handy, especially for all those java.net hosted projects, since FishEye has a free hosting offer for all of them. I've been using FishEye for my project, and grew to actually like FishEye. Still, Trac is the king!

    Posted by: vsizikov on March 13, 2007 at 02:17 AM

  • JIRA issue update doesn't work for me. :(
    Hudson: 1.86
    JIRA: Enterprise Edition, v.3.3.2
    Error log:

    Updating SOL-710
    FATAL: failed
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXException: Invalid element in com.atlassian.jira.rpc.soap.beans.RemoteComment - author
    faultActor:
    faultNode:
    faultDetail:

    org.xml.sax.SAXException: Invalid element in com.atlassian.jira.rpc.soap.beans.RemoteComment - author

    There are some differences in WSDL, particularly, in RemoteComment type.
    In my JIRA installation WSDL (grabbed from http://myjiraserver:8080/rpc/soap/jirasoapservice-v2?wsdl):

    <complexType name="RemoteComment">
    <sequence>
    <element name="body" nillable="true" type="xsd:string"/>
    <element name="id" nillable="true" type="xsd:string"/>
    <element name="level" nillable="true" type="xsd:string"/>
    <element name="timePerformed" nillable="true" type="xsd:dateTime"/>
    <element name="username" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>

    In used in Hudson (from https://hudson.dev.java.net/source/browse/hudson/hudson/plugins/jira/src/main/wsdl/jirasoapservice-v2.wsdl):

    <complexType name="RemoteComment">
    <sequence>
    <element name="author" nillable="true" type="xsd:string"/>
    <element name="body" nillable="true" type="xsd:string"/>
    <element name="created" nillable="true" type="xsd:dateTime"/>
    <element name="groupLevel" nillable="true" type="xsd:string"/>
    <element name="id" nillable="true" type="xsd:string"/>
    <element name="roleLevel" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>

    Seems that JIRA RPC interface is changing within 3.X branch.
    I see 3 possible ways to solve problem:

    rebuild plugin with proper WSDL (and fix the code a bit: author -> username);
    upgrade my JIRA;
    maybe we can make support of different versions of JIRA in this plugin. I can contribute code from point 1. :)

    Posted by: vglushenkov on March 13, 2007 at 06:06 AM


  • Thank you Kirill and Vladimir, I'm really flattered. But my point is that if people could write plugins, I can spend time on improving other things, and everyone wins.


    And you know that there is a trac plugin for Hudson, right? If you have improvement ideas, just file them away (or better yet, fix them away!)

    Posted by: kohsuke on March 13, 2007 at 06:30 AM


  • vglushenkov — thank you for an error report. In the future, consider filing those as an issue so that others can find it more easily, and you can get notified when we update issues.


    I believe my WSDL came from the latest 3.7.4. And so it sounds like JIRA is indeed breaking web interface compatibility between dot releases, which is bad. This kind of errors is exactly why people should be using JAX-WS and JAXB, which is much more robust in the face of changing service definitions! With JAX-WS this change would have worked no problem.


    Presumably people aren't updating JIRA installations that frequently? (Is that because people stop paying their "support&update" tax?) I'm afraid I probably have to support multiple JIRA versions.

    Posted by: kohsuke on March 13, 2007 at 06:41 AM

  • I just posted another version of Hudson and JIRA plugin to fix this problem (and a few other bug fixes.)

    Posted by: kohsuke on March 13, 2007 at 10:16 PM

  • Kohsuke: "if people could write plugins, I can spend time on improving other things, and everyone wins."

    Ok. you got me there. I´ll at least contribute a simple Jabber notifier Plugin i created yesterday. I´ll contact you soon about that.

    Posted by: uwe_schaefer on March 14, 2007 at 11:47 PM

  • Cool. Talk to you soon, uwe_schaefer.

    Posted by: kohsuke on March 15, 2007 at 10:33 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds