gabrie-allaigre / sonar-gitlab-plugin

Add to each commit GitLab in a global commentary on the new anomalies added by this commit and add comment lines of modified files
GNU Lesser General Public License v3.0
713 stars 207 forks source link

Fix issues retrieval for SonarQube Community Edition #227

Closed alessiofachechi closed 5 years ago

alessiofachechi commented 5 years ago

This pull request fixes the issue when using the Community Edition of SonarQube.

In this case the SonarFacade.getNewIssues() method tries to retrieve issues from the SonarQube branch defined through the sonar.gitlab.ref_name property, which is usually equal to the GitLab pipeline $CI_COMMIT_REF_NAME variable.

Branch Analysis is though part of the Developer Edition (and above), so we need to handle that specific situation in order to avoid SonarQube / GitLab mismatches.

gabrie-allaigre commented 5 years ago

Hi, Thanks. But missing test for new method. Sonarqube is asking to have an important code coverage for the new codes.

alessiofachechi commented 5 years ago

Hi @gabrie-allaigre. Done! :smiley: