Skip to end of metadata
Go to start of metadata

Name

BuildBug

Version

1.1

Product Versions

Bamboo 2.1

Author(s)

Brad Harvey

Homepage

http://confluence.atlassian.com/display/BAMEXT/BuildBug

Price

Free

License

BSD

JavaDocs

See Source

IssueTracking

http://developer.atlassian.com/jira/browse/BBB

Download JAR

buildbug-1.1.jar

Download Source

svn buildbug 1.1

Description

BuildBug is a Bamboo plugin to create JIRA issues when a build breaks.

Why is this Useful?

I see two main reasons to use this plugin. Firstly, the created JIRA issue provides immediate visibility to the build problem. You can assign the issue to a specific developer once the cause of the failure is known so everyone can see that someone has taken ownership of the problem.

The second reason is less apparent but potentially more beneficial. A build failure is usually associated with some form of waste:

  • Someone has to investigate the reason for the failure.
  • Someone has to fix the failure.
  • Potentially many people are held up from their integration tasks since they can't trust the codebase while the build is broken.

You can use the created JIRA issue (potentially in combination with work logs, custom issue types, work flows, resolutions etc) to record the following information for each build failure:

  • How much waste,
  • The cause of the waste.

Then you can use JIRA's search/reporting features to identify trends from your build failures, which will hopefully allow you to find and eliminate recurring problems.

For example, you may find a lot of builds failing due to infrastructure issues - this would allow you to better quantify the impact of these problems.

Features

When a Build Breaks, a JIRA Issue is Created.

When a build breaks, a new issue is created. The project, assignee, issue type and priority are configurable.

The following information is included in the issue:

  • Why the build failed.
  • Test Summary if tests were found.
  • List of Authors and associated JIRA issues based on commits.
  • A link to the full build log.

BuildBug adds Comments for Subsequent Builds.

The JIRA issue will show the current state of play because BuildBug adds a comment describing the last build result each time a new build completes, until the build is fixed.

Navigate Between Bamboo and JIRA

It's easy to jump back and forth between the JIRA issue and Bamboo build results.

There are links to Bamboo in the JIRA issue description/comments.

With the JIRA Bamboo plugin installed, the "Related Builds" tab shows the builds.

In Bamboo, the JIRA tab shows related JIRA issues including broken builds.

Installation/Setup

Prerequisites

The BuildBug plugin relies on Bamboo JIRA Integration. Please ensure your JIRA integration is working before attempting to install this plugin. One difference is that the JIRA user you supply must have permission to create JIRA issues in the projects you select for each build plan.

Install the Plugin

Install BuildBug as per Installing a Plugin.

Enable BuildBug for a Build Plan

To enable BuildBug, go to the "Post Actions" tab in the configuration for a build plan and scroll down until you see the BuildBug section.

Select the checkbox to enable BuildBug for this build plan.

Select Issue Details

You must select a project, assignee, issue type and priority for the JIRA issue that will be created. The values for the dropdowns come directly from JIRA. Assignee will be validated when you hit save.

There's also an option to use the author from the commit details as the assignee. This will only kick in when a single author is responsible for all the commits contributing to the build. When this is not the case (no commits, or multiple authors) or when the author is not a user in JIRA then the assignee field will still be used.

That's it! Now you get to break the build to test it out.

Possible Future Features

Something that could be useful is changing the state of the JIRA issue. For example, it could be resolved when the build is fixed. I'm not sure how complicated custom workflows will make doing this, so I'll hold off on this one unless people ask for it.

Release Notes

Version 1.1 - Bamboo 2.1 Compatibility

09 December 2008

Download JAR

buildbug-1.1.jar

Source

svn release_1.1

  • BBB-4 Bug - Buildbug plugin doesn't work with Bamboo 2.1

Version 1.0 - codegeist ready!

Download JAR

buildbug-1.0.jar

Source

svn release_1.0

  • BBB-2 Improvement - Include author and jira issues from commit messages in comments

Version 0.9 - release candidate

Download JAR

buildbug-0.9.jar

Download Source

buildbug-0.9.zip

  • New Configuration option - Priority. This controls the priority of the created JIRA issue.
  • New Configuration option - Assign to Committer. If enabled, the JIRA issue can be assigned directly to a committer. This will happen if there is a single committer that contributed to the build.

Version 0.4 - track fixing builds

Download JAR

buildbug-0.4.jar

Download Source

buildbug-0.4.zip

  • Comment on the issue and add a change entry when the build is fixed
  • Link to the build log in the JIRA comments
  • Include test results in the JIRA comments

Version 0.3 - useful for raising visibility of build problems by creating JIRA issues

Download JAR

buildbug-0.3.jar

Download Source

buildbug-0.3.zip

  • Visible/Clickable links between the JIRA issue and Bamboo build.
  • Configuration Enhancements
    • Select the project from a dropdown list of projects retrieved from JIRA
    • Validated that assignee is a valid JIRA user
    • Select issue type from a dropdown list of issue types retrieved from JIRA.
    • These configuration features degrade gracefully when JIRA can't be contacted during configuration (don't prevent the build plan from being saved).

Version 0.2 - proof of concept

Download JAR

buildbug-0.2.jar

Download Source

buildbug-0.2.zip

  • Migrate to Bamboo2
  • Only one issue per failure period is created.

Version 0.1 - proof of concept

Download JAR

buildbug-0.1.jar

Download Source

buildbug-0.1.zip

  • Can configure whether to enable BuildBug for a build plan, and a Project and Assignee
  • Use JIRA configuration details from JIRA plugin

Screenshots

7 Comments

  1. Hey Brad,

    Awesome idea. Looking like it's coming along nicely!

    It would definitely be a good idea to integrate the build with the JIRA issue. That way - if you have the Bamboo plugin switched on in JIRA, you can click back to it!

    The other thing - and I think you have this down, is that we need someway to prevent Bamboo continuously "spamming" JIRA on every failure. A JIRA issue per Bamboo failure period is definitely a good idea.

    Cheers,
    Edwin

    1. Yeah, one issue per failure period would be good. Although you could add a comment with some detail about changes in succeeding failing builds. Not strictly necessary though, since you can get that information in Bamboo. However, if your developers have put the original JIRA issue they're fixing in the checkin comments, adding the 'changed in this build' comments into the 'failure' issue will automatically link the 'failure' issue with the original JIRA issue the developer was supposedly fixing. Neat (smile)

      1. Thanks Edwin & David for the feedback. I'll make one issue per failure period a priority after Bamboo 2 support.

        (Edit: Feature implemented in 0.2)

  2. No matter what I do, it's not generating an issue in Jira when I fail the build.

    Is there something I can look for in the Bamboo logs that would give me a clue as to what is going on.

    I know the Bamboo/Jira integratrion is working, I can see builds in Jira and Issues in Bamboo, but

    no issue is opened when I fail the build.

    Thanks

    1. Hi Ken,

      What versions of Bamboo & Jira are you running?

      Do you see this text in the log?
      Running post build plugin on server 'BuildBug - JIRA Issue Creator'

      What causes the build to fail? I think I've only used the maven 2 builder and failed for compile errors / test errors, so perhaps could be something to do with that.

      Does the user configured for jira integration have permission to create issues in jira? I'd check both the bamboo & jira logs for clues.

      Brad.

      1. Jira 3.13.2, Bamboo 2.1.5

        The build fails because I intentially put typos in the java source code:

        05-Mar-2009 20:37:11

        javac:

        05-Mar-2009 20:37:12

          [javac] Compiling 2 source files to /opt/Bamboo/Bamboo/xml-data/build-dir/IM-IMT/im/build/classes

        05-Mar-2009 20:37:13

          [javac] /opt/Bamboo/Bamboo/xml-data/build-dir/IM-IMT/im/src/java/com/e2open/im/server/PermissionManager.java:63: ';' expected

        05-Mar-2009 20:37:13

          [javac]   private static finalll String ALLOW_ACCESS = "SELECT * FROM IM_ROLE_ENTITY A, IM_ROLE B WHERE A.ROLE_KEY = B.ROLE_KEY"

        05-Mar-2009 20:37:13

          [javac]                                 ^

        05-Mar-2009 20:37:13

          [javac] 1 error

        05-Mar-2009 20:37:13

         

        05-Mar-2009 20:37:13

        BUILD FAILED

        05-Mar-2009 20:37:13

        /opt/Bamboo/Bamboo/xml-data/build-dir/IM-IMT/im/sysbuild/build.xml:50: The following error occurred while executing this line:

        05-Mar-2009 20:37:13

        /opt/Bamboo/Bamboo/xml-data/build-dir/IM-IMT/im/build.xml:502: The following error occurred while executing this line:

        05-Mar-2009 20:37:13

        /opt/Bamboo/Bamboo/xml-data/build-dir/IM-IMT/im/build.xml:460: Compile failed; see the compiler error output for details.

        05-Mar-2009 20:37:13

         

        05-Mar-2009 20:37:13

        Total time: 1 minute 26 seconds

        05-Mar-2009 20:37:13

        Build process for 'IM - IM Trunk' returned with return code = 1

        05-Mar-2009 20:37:13

        Running post build plugin 'Post Command Agent Runner'

        05-Mar-2009 20:37:13

        Running post build plugin 'Clover Results Collector'

        05-Mar-2009 20:37:13

        Running post build plugin 'Artifact Copier'

        05-Mar-2009 20:37:13

        Finalising the build...

        05-Mar-2009 20:37:13

        Stopping timer.

        I found the log entry, seems to indicate it ran:

        Bamboo log:

        2009-03-05 20:37:13,808 INFO [BAM::Agent 007::Agent] [LocalBuildResultProcessor] Running post build plugin on server 'BuildBug - JIRA Issue Creator'
        2009-03-05 20:37:14,076 INFO [BAM::Agent 007::Agent] [LocalBuildResultProcessor] Running post build plugin on server 'Post Command Server Runner'
        2009-03-05 20:37:14,198 INFO [BAM::Agent 007::Agent] [PostBuildCommandServerAction] post command not set to run on server, skipping
        2009-03-05 20:37:14,199 INFO [BAM::Agent 007::Agent] [LocalBuildResultProcessor] Running post build plugin on server 'Clover Delta Calculator'
        2009-03-05 20:37:14,285 INFO [BAM::Agent 007::Agent] [AbstractBuilder] Build failed since return code was not 0

        I can't find anything suspicious in Jira logs.

        Build is run via a shell script that setups a few things and invokes ant, and returns ant's return code:

        #!/bin/sh
        . build.env
        echo $JAVA_HOME
        echo $ANT_HOME
        echo $ANT_OPTS
        x=`pwd`
        y=`dirname $x`
        z=`dirname $y`
        ant -Dpkgdir=$PKGDIR compile package -Dtopdir=$z
        exit $?

        As far as issue creation permission goes, that shouldn't be a problem.

        Create Issues
        Ability to create issues.

        Group (Anyone) (Delete)

        So, if you have any suggestions on how to debug this, I would appreciate it.

        Thanks.

         

         

        1. I think you found an interesting bug. It looks like the build can fail after the buildbug plugin runs (note the first & last entries from your bamboo.log snippet). I thought this might be a possibility, but couldn't think of a way around it at the time - I needed to add fake commit comments before the build result was saved. I had thought it would only occur if another plugin failed the build, but obviously that's not the case!

          It might be worth trying a straight ant build with the ant builder. The maven builders seem to detect that the build has failed sooner in the process, perhaps the ant builder does the same.

          With bamboo 2, it should be possible to switch from using fake commit comments to using the in built jira issue linking feature, assuming the api is available to the plugin. I haven't had a chance to look into this, and can't promise anything anytime soon (sad)