sonar-gitlab-plugin
sonar-gitlab-plugin copied to clipboard
Inline comment only generated in Master branch
I am using [email protected] and [email protected],
My gitlab-ci.yml is:
sonar-scanner \
-Dsonar.projectKey=$SONAR_KEY \
-Dsonar.sources=. \
-Dsonar.host.url=$SONAR_URL \
-Dsonar.login=$SONAR_LOGIN
-Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA \
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME \
-Dsonar.gitlab.project_id=$CI_PROJECT_ID
Commit in non-master branch
If this commit not on the Master branch, when quality gate is failed, SonarQube always generates global comment like below:

But always says "reported no issues" and `no inline comment`,
Commit in Master branch
However, commit in Master branch (with same changes), it generates global comment with issues and inline comments :
I expect it generates global comment with issues and inline comment on all branch.
Any help would be appreciated!
I observe same issue, [email protected] and [email protected],
I recently ran into this issue and found that it was because of a mismatch between the branch name being given to Sonarqube and the ref_name argument.
Try using these two arguments -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.branch.name=$CI_COMMIT_REF_NAME.
I recently ran into this issue and found that it was because of a mismatch between the branch name being given to Sonarqube and the ref_name argument.
Try using these two arguments
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.branch.name=$CI_COMMIT_REF_NAME.
Hi , george, I can't use the arguments Dsonar.branch.name you mentioned, I am using Community Edition. Does sonar branch relate gitlab branch ?
I recently ran into this issue and found that it was because of a mismatch between the branch name being given to Sonarqube and the ref_name argument. Try using these two arguments
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.branch.name=$CI_COMMIT_REF_NAME.Hi , george, I can't use the arguments
Dsonar.branch.nameyou mentioned, I am using Community Edition. Does sonar branch relate gitlab branch ?
It looks that it's limitation of community edition. Analysis is run only on master branch. Too bad....
Yup, unfortunately you won't be able to analyze multiple branches on the community edition and I believe the Gitlab Issues come from the branches issues even if the quality gate works... I don't think anything can be done about this w/o upgrading.
@jeoy . Why don't you try open source branch plugin: https://github.com/msanez/sonar-branch-community I installed it, and it work for me with other branch than master
@jeoy . Why don't you try open source branch plugin: https://github.com/msanez/sonar-branch-community I installed it, and it work for me with other branch than master
This plugin is deprecated !
@jeoy . Why don't you try open source branch plugin: https://github.com/msanez/sonar-branch-community I installed it, and it work for me with other branch than master
This plugin is deprecated !
In the docs it links to the current version of the plugin. It seems to be maintained and supposedly works with version 7.4+. I can't test it out myself, but would this work?
I has installed the sonar-branch-community plugin. But I still has the same issue as you. Have you solved the problem? If you can give me some advice , I will be grateful.
@jeoy . Why don't you try open source branch plugin: https://github.com/msanez/sonar-branch-community I installed it, and it work for me with other branch than master
Hi, Do your Gitlab VERSION is Commuity Edition? I have installed the same plugin, But it doesn't work .Could you please help me?
Oh! I got some tips. If I do not analyze my primary branch(master) by sonarqube. It will occur no issue. But if I do it , other branchs will return master branch's report,like this. and it still has no inline comment.
So I think it should be the community edition branch function leads to it.

