26.4. Bugzilla

26.4.1. Overview

The Bugzilla sensor is implemented as an ANT task that parses Bugzilla report file in CSV format, and send the information about the bugs as Issue sensor data to the Hackystat server. The information about Issue sensor data type is documented in Section 25.12, “Issue”. The sensor itself does not contact Bugzilla server to retrieve the report. One way to do it is to use the ANT "get" task.

26.4.2. Installation

26.4.2.1. Prerequisites

The Bugzilla sensor requires Java 1.5.0 or later, Ant 1.6.5 or later. Since the sensor only parses Bugzilla CSV report file, there is no requirement on Bugzilla server, so long as you can retrieve its report file and save it in CSV format.

26.4.2.2. Download HackyInstaller and set your Hackystat Host and User Key

Follow the instructions in Chapter 2, Client-side configuration: Tool sensor installation to set your Hackystat host and user key.

26.4.2.3. Configure and install the Bugzilla sensor

In the HackyInstaller main window, select the Bugzilla sensor and press "Configure Selected Sensor". Figure 26.5, “ Bugzilla sensor installer configuration window ” shows what the configuration window should look like after the path to Ant is set, the sensor is enabled, and the "Install" button has been pressed to install the sensor.

Figure 26.5.  Bugzilla sensor installer configuration window


Bugzilla sensor installer configuration window

This sensor supports the following properties and paths:

  • Enable Bugzilla Sensor: This property controls whether the sensor is active or not. If not checked, the sensor will not collect or send data even if installed.

  • Ant home directory: This path specifies the top-level directory for Ant. The Bugzilla sensor requires the placement of a sensor executable into Ant's lib/ directory.

26.4.2.4. Setup the User Mapping from Bugzilla account names to Hackystat user keys

Bugzilla is a "multi-user" tool; in other words, the Issue data collected by the Bugzilla sensor must be distributed among potentially many different Hackystat user accounts. To support the mapping of Jira data to Hackystat user accounts, you must specify the mapping of Bugzilla usernames to Hackystat user keys using HackyInstaller. Section 2.7, “Sensors for multi-user tools and the usermaps.xml file” contains detailed instructions on this process.

[Note]Note

The tool name in the usermaps.xml file must be "Bugzilla".

26.4.2.5. Run the Bugzilla Sensor

The sensor is written as an Ant task. Example 26.7, “Invoking the Bugzilla sensor with ANT” illustrates an example Ant target.

Example 26.7. Invoking the Bugzilla sensor with ANT

  <target name="run">
    <get src="http://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?bug_status=__all__&product=WorldControl&content=testnew&ctype=csv"
            dest="bugzilla.report.csv" />
    <taskdef name="bugzilla-sensor" classname="org.hackystat.sensor.bugzilla.BugzillaSensorAntTask" />
    <bugzilla-sensor issueIdMapping="bug_id" 
                issueStatusMapping="bug_status"
                defaultPath="C:\bugzilla\" 
                defaultIssueType="bug"
                inputBugzillaCsvFile="bugzilla.report.csv"
                debug="true"
                issueAssigneeMapping="assigned_to"
                defaultHackystatAccountKey="testdataset" />
  </target>

In the above example, the "get" task sends a request to a testing server at bugzilla.org to retrieve a report file in CSV format. You might want to use diffent search criteria by setting different parameter values. You can find relevant information in Bugzilla documentation. Note that the last request parameter is "ctype=csv". The response is illustrated in Example 26.8, “Sample Bugzilla CSV Report File”.

Example 26.8. Sample Bugzilla CSV Report File

  bug_id,"bug_severity","priority","op_sys","assigned_to","bug_status","resolution","short_desc"
  949,"normal","P2","Windows 2000","a@c.com","NEW",,"testnew"
  999,"normal","P2","Windows 2000","b@c.com","NEW",,"testnew"

The "bugzilla-sensor" task is responsible for parsing the CSV file and sends issue sensor data to the Hackystat server. Note that the issue data are sent to individual account according to the assignee of each Bugzilla bug through Hackystat usermap mechanism. The attributes of the task is described in Table 26.2, “Bugzilla Sensor Ant Task Attributes”.

Table 26.2. Bugzilla Sensor Ant Task Attributes

AttributeDescriptionRequired?
issueIdMappingThe name of the column under which the sensor should look for issue id information.Required
issueStatusMappingThe name of the column under which the sensor should look for issue status information.Required
pathMappingThe name of the column under which the sensor should look for issue path information. The path information is used in Hackystat metrics analyses to associate issues to a project.One of 'pathMapping' and 'defaultPath' must be set, but not both.
defaultPathIn case there is no path information in the Bugzilla report file, this attribute allows you to hard code a path value. The path information is used in Hackystat metrics analyses to associate issues to a project.One of 'pathMapping' and 'defaultPath' must be set, but not both.
issueTypeMappingThe name of the column under which the sensor should look for issue type information.One of 'issueTypeMapping' and 'defaultIssueType' must be set, but not both.
defaultIssueTypeIn case there is no issue type information in the Bugzilla report file, this attribute allows you to hard code an issue type value.One of 'issueTypeMapping' and 'defaultIssueType' must be set, but not both.
inputBugzillaCsvFileThe path to the Bugzilla report CSV file.Required
issueAssigneeMappingThe name of the column under which the sensor should look for assignee of each Bugzilla issue.Optional, but at least one of 'issueAssigneeMapping' or 'defaultHackystatAccountKey' must be set.
defaultHackystatAccountKeyThe fallback Hackystat account to send Bugzilla issue information in case the sensor cannot figure out which Hackystat account to use. If 'issueAssigneeMapping' is unspecified, then this is the account that received all Bugzilla issue information.Optional, but at least one of 'issueAssigneeMapping' or 'defaultHackystatAccountKey' must be set.
debugWhen set to 'true', diagnostic messages are printed.Optional. Default is 'false'.

26.4.3. Installation troubleshooting

26.4.3.1. Troubleshooting general client-server problems

The first step in troubleshooting your sensor installation is to verify that your Hackystat host and key settings are valid and that you can contact the Hackystat server, as described in Section 2.4, “HackyInstaller GUI: Setting and verifying the Hackystat host and user key”

26.4.3.2. Submit a trouble report

If none of the above troubleshooting activities solves your problem, then you should send an email to your Hackystat Administrator to request help. Please include in your email the following information:

  • The output from 'java -version'.

  • The output from 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

  • The contents of the Bugzilla.x.log file.

  • A description of the problem you are having.

26.4.4. Uninstallation

To disable the Bugzilla sensor data collection temporarily, invoke HackyInstaller, bring up the Bugzilla configuration window, and uncheck the "Enable Bugzilla sensor" property, and apply the setting. To permanently uninstall the Bugzilla sensor, bring up the Bugzilla configuration window, press the "Uninstall" button, and remove the Bugzilla sensor targets from your Ant build.xml files.