Saturday, August 20, 2016

Using the Error Reporting Tool


org.wso2.developerstudio.eclipse.errorreporter plugin is a Eclipse plugin that works with version 3.5 or above. Once the plugin is installed with Developer studio plugins, it automatically detects any errors related to Developer studio. It allows the Developer Studio user to create an issue in Jira under the relevant Eclipse project and also to send an email with the error report to any user given recipient, without leaving the IDE.

Preference Page

The Error Reporting Tool provides a preference page to maintain the user preferences. It is the best practice to set the mandatory fields in this preference page as early as possible, because that affects the report publishing task.

The preference page of Error Reporting Tool can be found at General-.> Preferences->Developer Studio Error Reporting. The Preference Page is shown in Figure 1.

Figure 1

Contact Information

Entering the contact information is optional. This information will be useful for the development team to contact the user, if there is any need for follow up conversations.

Sending Options

The user is given two sending options to select.
  • Report the error in Jira

By selecting this option, the user can chose to post the issue in WSO2 Jira

  • Report the error in Jira and send an email

By selecting this option, the user can chose to post the issue in WSO2 Jira and also to send an email to a user given email address in the Gmail information section.

Jira – Information

Filling this section is mandatory. The Developer Studio Users need to fill in the Remote Jira URL and Inquiry status URL.
  • Remote Jira URL - ”{URL of the remote micro service}/publish/jira”
  • Inquiry Status URL - ”{URL of the remote micro service}/publish/status”
  • Default Project Key - This is the key of the Project, the issue is reported in Jira. By default this is filled as “TOOLS”.

Gmail – Information

Filling this section is mandatory if the user has selected “Report the error in Jira and send an email” option in sending preferences.
  • Remote Email URL - ”{URL of the remote micro service}/publish/email”
  • Recipient Email – Email address of the recipient, user wishes to send the email to.

Error Reporting Process

Whenever a plugin reports an error to the Eclipse error log, and if that error is related to a Developer Studio plugin, the error notification dialog pops up (Figure 2), asking the user to report the error.

Figure 2

Here the user is given the option to view the details of the Error Report that is emailed and sent to Jira (Figure 3). If the user is comfortable with the error report, he can select one of the two options, Publish in Jira or Publish in Jira and email. The sending option would be the option set at the preference page.

Figure 3

If the user selects OK, the error reports will be published, displaying the following widow (Figure 4).

Figure 4

In case where the user has not set the mandatory fields in the Preference Page, he will be prompted first with the dialog box given below in figure 5. The user can follow the link given there and set the mandatory fields in the Preference Page. Upon completion of the mandatory field, the user will be prompted with the dialog box given in figure 2.

Figure 5

Report Archive

The Error Reporting Tool allows the users to view the previously sent error reports and their current status. The Report Archive can be viewed at Error Reporter -> Report Archive. By selecting the listed reports, user can view the error report in the text box.

User can get to know the current status of any listed issue using "Inquire Status" context menu option.

Figure 6

How other plugins can extend

This plugin provides an extension point for the other Developer Studio plugins to extend. This extension provides an element- ‘ProjectKeys' with two attributes - package and key. The plugins which extends this extension point can provide their own Project key in WSO2 Jira as the key and their plugin ID as the package. Once an error takes place and if that error is related to any of the extended plugins, the project keys defined by those plugins would be used when posting the issue in Jira.

Extension point ID-org.wso2.deveoperstudio.eclipse.errorreporter.jirakey

Important Facts

  • For any error to be recognized as a related error to Developer studio, the plugin name and packages should follow the default naming convention. Ex- the package names should start with org.wso2.developerstudio…
  • By default, issues would be created under the project ‘TOOLS’ in Jira. However if the plugins related to the error have defined their relevant project keys using the extension point, those keys would be used in posting the issue.
  • By default the error reports are stored in a directory called ErrorReports at user directory. If this directory or its contents are changed, it may affect the functionality of the Report Archive.
  • This plugin automatically starts once the Developer Studio workbench loads. If the user wishes to disable this early startup behavior, that can be by unchecking the Error Reporter Tool at Windows-> Preferences-> General->Startup and Shutdown, as depicted in figure 7.

Figure 7

However note that once this start up behavior is unchecked, the plugin would no longer detect any errors. But the error report archive would function.

Contact Development Team Feature in Developer Studio

GSOC 2016

For the past 3 months, I got the opportunity do a project in WSO2 for GSOC 2016. My project was to develop the Contact Development Team Feature in Developer Studio.

Developer Studio is an eclipse based IDE which provides complete Eclipse­based SOA development environment for WSO2 Carbon middle-ware platform. Developer Studio provides comprehensive support for developing tools and speedup the development process while ensuring unified tooling user experience across Carbon platform.

Currently Developer Studio users contact the development team via WSO2 web support portal (Jira), so the users have to put additional effort to send error logs, metadata etc. More importantly sometimes users are not aware of sending error logs and other required metadata and as a result most of the bugs get unnoticed.

My GSOC project goal was to develop a new plugin for the users to be able to contact development team within the IDE itself.  This new plugin can be used to capture and report errors to Development team (WSO2).

This is how the new plugin works.

  • When an unexpected error occurs in Developer Studio IDE, the plugin captures this error.
  •  If the error is caused by any plugin related to WSO2 Developer studio, the plugin would collect all the relevant Meta information, the log files, plugin information, java version information and Operating system information that would be useful for the development team to fix the error.
  •  Using the error information and user information, a text report would be generated and displayed to the user for approval.
  • The user can select the option to publish the error in WSO2 Jira or to both publish the error in Jira and email to a user given email address.
  • A remote micro service hosted in WSO2 cloud would be used for the Jira and email publishing.
  • Each error report sent would be persistently stored in the system and they can be viewed using the report archive of the plugin.
  •  The user can inquire the current status of the issue in Jira using the report archive.
  •  A preference page is developed for the plugin, so the user information like name, organization and contact information, the remote micro service URL and Jira project keys and sending options can be set by the user.
  • An extension point is defined by the plugin, so that other plugins can extend it to contribute their plugin IDs and Jira project keys to create an issue in Jira, under their Projects.

The initial project plan was to perform the Jira publishing and Email publishing tasks within the plugin itself. However since that approach had certain limitations like every Developer Studio user needs to have a WSO2 Jira account and a Gmail account, we decided to externalize this task.
For that I developed a micro service and provided the Jira Publishing and email sending services through a single common Jira account and a Gmail account. This way I could easily externalize and standardize the Jira and Email publishing methods. 

Deliverable of the project

The links of key deliverable of the project are listed below.

1. Eclipse plugin project
2. Remote Jira Publisher - Micro service

The links for my GitHub commits are listed below.


Tips on how to use the Error Reporting Tool can be found here.
Using the Error Reporting Tool

Thank You

  • Thank you WSO2 for giving me this opportunity to participate in Google Summer of Code Program. Participating in this program helped me learn a lot of new things and to improve my skills.
  • Thank you my mentors, Jasintha Dasanayake and Kavith Lokuhewage for selecting me for this project, for the guidance and support extended throughout this period and for helping me to complete this project successfully.
  • Thank you Dinanjana Gunaratne for encouraging me to apply for the GSOC program and supporting me throughout this period.