Command-line tool to copy issue features (status, resolution) from one SonarQube project to another.
Both projects (origin and destination) can be in the same of different SonarQube server.
Issue features currently covered:
- Statuses: Open
- Resolution: False-positive
Scenario Example:
SonarQube instance with Project_A containing thousands of issues.
Some of them have been manually flagged to status "Confirmed" or "False-Positive".
At one point, Project_A is forked and a new analysis is run. Analysis results are stored in a new branch (let's call it "Production") in the same (or different) SonarQube server.
So, now we have:
- Project_A : Mix of "Open", "Confirmed" and "False-Positive" issues.
- Project_A Production : Same list of issues as in Project_A, but all are "Open".
As a developer, I want to flag the issues in 'Project_A Production' branch before starting to change code, so that new analysis contains same "flags" (Confirmed, False-positive) as the original one.
That is what this tool is for.
JRE 8
$ mvn clean install
A deliverable zip will be generated in target folder.
- Donwload (TODO: link) o create deliverable zip following previous instructions.
- Unzip "sonar-issue-migrator-bin.zip" to a directory.
Steps to copy issues from Project_A to Project_B:
- Run SonarQube analysis on Project_A:branch_A (note: using Sonar branches is optional)
- Run SonarQube analysis on Project_B:branch_B (note: using Sonar branches is optional). IMPORTANT: source code of Project_A and Project_B should be as similar as possible to each other.
- Edit conf/configuration.properties (please read comments in configuration.properties file).
- Navigate to folder where you have unzipped "sonar-issue-migrator-bin.zip". It should contain SonarIssueMigrator.jar. Execute:
$ java -jar SonarIssueMigrator.jar
- Program will start running. Once execution is done, it will show:
- Total number of flagged issues obtained from URL (flagged_issues_url parameter in config file)
- Number of matched issues: how many open issues have been found in destination project ('Project_B') matching the flagged ones. The tool compares issues based on <Component, Rule, Line> triad.