Hi all,
we are using SonarQube in our company and have the following situation:
- Git as version control
- code review flow based on pull requests (to be approved, the code to be merged must pass the Quality Gate)
- we have several legacy projects with long history with hundreds of issues of severity Major or above
- projects are tested and in production => we cannot simply fix the issues without significant effort and regression testing
- we address the issues step by step in smaller batches => this results in Sonar analysis ending up with above Major issues and failing Quality Gates
Even though we have old issues in the projects, we want the continuous Sonar analysis to prevent new issues being brought in. Therefore, we mark the old issues as won't fix so that the project passes the Quality Gate - we want it to fail only in case new issues appear.
We end up with a project in SonarQube with sometimes complex issue settings (marked as won't fix etc.). The Sonar analysis is usually triggered by Jenkins on the main development branch (lets say master).
Now a developer comes in, creates a feature branch, implements the feature and creates a pull request. Both the code reviewer and developer are supposed to run the Sonar analysis against the feature branch (with sonar.branch property set). This creates a new project in the SonarQube (which is desirable) but this is where our troubles come into play. Even though the developer did not introduce new issues implementing the feature, the analysis fails the Quality Gate because of the legacy issues not marked as won't fix.
Of course, the developer can run the analysis first on the clean feature branch, mark all issues coming from master as won't fix... BUT, this leaves our code quality process at the mercy of developer being honest - nothing prevents him to mark newly introduced issues as won't fox...
So, it would be really great to be able to clone the project in SonarQube with new project key => ALL the issue settings would be in place in the new project.
I googled a bit and it seems that there is no possibility to do this (clone a project - http://stackoverflow.com/a/33625537/5048604). I can image that it really wouldn't be very complex task to implement such functionality.
Or is there some misunderstanding or misuse of SonarQube in our code quality process? Can our goal be achieved with the SonarQube as is?
Thanks a lot for reply.
Regards
Pavel