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 208 forks source link

Missing rule violation #126

Open sesigl opened 6 years ago

sesigl commented 6 years ago

Hey,

I updated to the latest sonarqube version 7.0.0.36138 and switch to aws rds postgres.

In sonarqube itself it looks fine. But the gitlab plugin doesnt report any rule violations. I only get reports regarding the quality gate like maintainablility 1 < 3.

What's wrong ? No rules are checked and therefore no issues are commented to the commit.

gradle command:

./gradlew project:sonarqube -Dsonar.gitlab.project_id=projectId/projectId -Dsonar.gitlab.commit_sha=$(git log --pretty=format:%H origin/master..origin/$GIT_BRANCH | tr '\n' ',') -Dsonar.gitlab.ref_name=$GIT_BRANCH --stacktrace

I force to comment sonarqube below every merge request and only get the result:

SonarQube analysis indicates that quality gate is failed.

Security Rating on New Code is passed: Actual value 1
Reliability Rating on New Code is passed: Actual value 1
Maintainability Rating on New Code is failed: Actual value 3 > 1
Coverage on New Code is passed: Actual value 100.0
Duplicated Lines on New Code (%) is passed: Actual value 0.0
SonarQube analysis reported no issues.

Gradle log:

:project:sonarqube
Maintainability Rating on New Code: 3 > 1

BUILD SUCCESSFUL
sesigl commented 6 years ago

It works if I add -Dsonar.analysis.mode=preview

But this is deprecated: The use of the issues mode (sonar.analysis.mode=issues) is deprecated. This mode will be dropped in the future.

What flag can I use to push coverage and code changes to sonar & get the issues in gitlab that is not deprecated?

sesigl commented 6 years ago

One more weird thing is now that he can not find the commit itself...

Note: The following issues were found on lines that were not modified in the commit. Because these issues can't be reported as line comments, they are summarized here:

But at least there is a comment pointing to the issue below the MR.

sesigl commented 6 years ago

using sonarqube gradle plugin 2.6.2

has anyone an idea ?