Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonarqube quality badges on gitlab

I have a project on gitlab for which I'm trying to display quality badges from sonarqube on. For that I used the "Get project badges" button on the bottom right corner of your sonarqube project overview. They give you for each badge a Markdown which you can easily copy & paste to your README.md file on gitlab/github.

"Get project badges" window

Markdown looks like this: [![Bugs](https://yourprojectonsonarqube/api/project_badges/measure?project=your_project_key&metric=bugs)](https://yourprojectonsonarqube/dashboard?id=your_project_key)

For me it looks like this on the README.md file(logged in as maintainer):

My view on my repository as logged in Maintainer

For other users on the project which also have maintainer or developer permissions it looks like this:

The view of other people on my repository logged in also as Maintainer/Developer

If you click on the missing images, it will redirect you to sonarqube and ask for you to log in. Afterwards the images are visible. How can I change that? I want them to always be visible to every user of my project.

like image 301
JonathanAge Avatar asked Jul 02 '20 09:07

JonathanAge


People also ask

How Sonarqube works with GitLab?

SonarQube's integration with GitLab Self-Managed and GitLab.com allows you to maintain code quality and security in your GitLab projects. With this integration, you'll be able to: Authenticate with GitLab - Sign in to SonarQube with your GitLab credentials.

How do you integrate Sonarqube quality gate with GitLab CI CD?

Create a . gitlab-ci. yml file in the root of your project: stages: - sonarqube - docker_build image: maven:3-jdk-8 sonarqube: stage: sonarqube script: - # sonarqube running command (plugin installed), mvn blabla docker_build stage: docker_build script: - docker build .

What are badges in GitLab?

Badges are a unified way to present condensed pieces of information about your projects.


1 Answers

If this is for a private project on SonarQube, this is most likely a permissions issue.

There is currently an open issue for SonarQube to allow this to work: https://jira.sonarsource.com/browse/MMF-1942

As an FYI, this feature has already been implemented for SonarCloud: https://jira.sonarsource.com/browse/MMF-1178.

like image 84
Rekovni Avatar answered Dec 04 '22 08:12

Rekovni