Since 4.0, you can add your own test report plugin by using report plugin APIs. Normally, an typical issue tracker plugin contributes below extension points:
- BuildTabContribution displays a tab in build page to show related issues
- BuildSummaryContribution displays a summary section to show how many issues are related in a build in build dropdown
- Gadget displays the related issues of a configuration in Dashboard page
- CommentTransformer hyperlink the issues occurred in commit comment by a pattern
- StatisticsSupport collects issues by build so that we can compare with a specified build
even more, contribute some steps to create/update issues.
You needn't write the plugin from ground up, plugin com.pmease.quickbuild.tracker.core implements and encapsulates most of them already, just follow below instructions to create an issue tracker plugin. If you are not familiar with how to set up your development environment or how to create and test a plugin, please read [plugin tutorials] and some plugin examples first. Or you may read the Redmine plugin source code directly. Below we will show you how to add a Redmine plugin.
Every issue tracker plugin needs a plugin activator. As plugin com.pmease.quickbuild.tracker.core has already done a lot of things, add it to plugin dependencies in MANIFEST.MF, and actually, in most cases, you only need this dependency.
And then, implement the activator by extending AbstractTrackerPlugin:
It is fairly simple, and we will discuss more detailed below.
IssueTracker is an interface which tell QuickBuild how to fetch issue related information from remote server:
To implement IssueTracker, extend com.pmease.quickbuild.plugin.tracker.core.AbstractIssueTracker which implements most of the functions above:
fetchIssues() is tracker related, you need implement according to your issue tracker API.
Class Issue includes below properties:
All issues report will be saved to your configuration or build reports directory. The IssueCategory encapsulates the issue related operations, like save/load from H2 database, displays to user, etc. So implement your IssueCategory like below:
You need add a configuration setting class let user define the issue tracker server:
AbstractTrackerSetting defines below properties:
Just add as more fields as you need to the setting class, and apply some annotations to your getter method, QuickBuild will display the form without writing one line for GUI. See this page for details. For example, we add associate project to RedmineSetting:
Now, in Redmine setting, a new field Associated Project is added which is a required field and also user can use script to provide this property.
Finally, package the plugin and copy to QuickBuild server plugins directory, restart QuickBuild. To test your plugin, here is Redmine, you need:
- configure the Redmine Server in configuration settings
- add a repository to the configuration
- add a checkout step
- trigger a build
- submit some modifications to your repository, in the commit message, add some issues you want
- trigger a build again
If you are lucky, you can find all issues mentioned in commit messages are hyperlinked and a tab named Redmine which displays all issues mentioned in commit messages is added in build page.
Exposing Issues Report
You can also expose your issues report via REST:
and then add this class to the plugin activator so QuickBuild can know you want to expose it:
And now you can visit below URL to access your issues report:
See Interact with Issues for all RESTful functions.
Contributing to Dashboard
If you want to display your issues report to Dashboard, you can create a Gadget class:
and then add to your plugin activator like:
Now, in Dashboard page, you can find a gadget named Redmine Issues is available. When add it to your dashboard, you may see the gadget like below:
If you want to create/update issues, you can add some step class to do this, and add them to your plugin activator like below:
Creating an Issue Tracker Plugin - QuickBuild 6.0.x - PMEase
Playframework 2.0 - Play 2.3, activator does not work - Stack Overflow