We are using SonarQube 7.9.6. We would like to promote sonar analysis in CI tools like GitLab using Sonar project Badges.
We have followed steps to configure sonar project badges in GitLab and ensured that we are using token for secure communication between SonarQube and GitLab.
It is observed that we are not seeing sonar badges in GitLab as expected and getting results as below:
Please note that we have enabled enforced user authentication in SonarQube(Administration > General Settings > Security).
The sonar project in question is public one.
Hi, project badges don’t work with force authentication enabled in 7.9.6.
This has been improved with SonarQube 9.2 & SONAR-13426. Starting with SonarQube 9.2, project badge links are generated with a dedicated token in the URL that allows access only to this badge.
Hence, it can’t be set at Group Level and using Placeholders on project level (available placerholders are %{project_path}, %{project_id}, %{default_branch} and %{commit_sha}). If one could set manual placeholder (as with environment variables) then it would work.
Another option is of course to use the Markdown version instead.
Any suggestion that scale over multiple (40+) projects would be highly appreciated.