willemsrb / sonar-issueresolver-plugin

Export and import resolved issues

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue resolver Plugin for SonarQube Build Status Quality Gate

Requires SonarQube 6.3+

This plugin allows you to synchronize and export issue data (status, resolution, assignee and comments) of issues that have been confirmed, reopened or resolved. After exporting the data you can import it into a project where the issues in that project will be matched with the exported issue data; if matched the issue will be confirmed, reopened or resolved. Optionally the matched issue can be assigned to the same user and missing comments can be added. When working within one SonarQube installation the issues can be updated between projects directly.

Use cases:
  • Keeping resolved issues in sync between the master and a release/feature/maintenance branch
  • Using the list as a delivery for QA reports

Matching issues, assignees and comments

Issues are matched using the component, rule and linenumber. If an issue is matched it will be reported as 'matched'; if no transition can be determined to reach the exported status and resolution a 'matchFailure' will be reported. If the transition could not be succesfully completed a 'transitionFailure' will be reported.

Assignee are matched using the username; the issue will be assigned to the assignee if the username is different and the issue will be reported as 'assigned'. If the assignment could not be succesfully completed an 'assignFailure' will be reported.

Comments are matched by comparing the markdown. If a comment is not present on the issue it will be added and the issue will be reported as 'commented'. If a comment could not be succesfully added a 'commentFailure' will be reported.

Resolving issues

When transitioning, assigning issues or adding comments the current logged in account will be used.

Usage

  • Install the plugin via the Update Center in the SonarQube administration pages. Or to install the plugin manually; copy the .jar file from the release to the extensions/plugins directory of your SonarQube installation.

  • Find the page 'Issue resolver' under the project Administration section.

Update
  • Select the plugin in the project you want to update issues in. You will need 'Browse' and 'Administer issues' (to resolve issues) permissions for this project.
  • Select the 'Update' tab.
  • Select the project you want to read issues from. You will need 'Browse' permission for this project.
  • Press the 'Update' button to read, match and resolve issues.
Export
  • Select the plugin in the project you want to export issues for. You will need 'Browse' and 'Administer issues' (to be able to reach the Administration section) permissions for this project.
  • Select the 'Export' tab.
  • Press the 'Export' button to download a datafile containing the resolved issues from the project.
Import
  • Select the plugin in the project you want to export issues for. You will need 'Browse' and 'Administer issues' (to resolve issues) permissions for this project.
  • Select the 'Export' tab.
  • Select the datafile containing the issues to import
  • Press the 'Import' button to upload the datafile and match and resolve issues.
Preview

Use the preview option to preview the matching results. No actual changes will be made to the project.

Webservices

The main work for the plugin is done via webservices that are available via the SonarQube Web API (see SonarQube -> Helper -> Web API):

  • Update issues from another project: http POST to /api/issueresolver/update
  • Export issues from a project: http GET to /api/issueresolver/export
  • Import issues in a project: http POST to /api/issueresolver/import

These webservices can be used by external tools to trigger the functionality.

About

Export and import resolved issues

License:Apache License 2.0


Languages

Language:Java 84.7%Language:JavaScript 15.3%