Sonarqube - Gitlab CI/CD on pre-existing projects

My organization has about 200 Sonarqube projects that we would like to get integrated into our new instance of Gitlab self hosted. We are trying to take advantage of the MR annotations which come with the integration. It seems like the integration works when we create a new Sonarqube project using the Gitlab steps according to the SQ documentation, but don’t see a way to create the integration off of an already existing Sonarqube project. Is there a way to do this? We want to avoid creating new Sonarqube projects because a lot of the history with those projects would be lost if we created new ones. Thanks!


Welcome to the community!

For the existing projects, make sure the Project Settings → General Settings → DevOps Platform Integration details are set.


You were right - I was able to find the project settings and get the platform integration details set. However, I noticed something interesting and was wondering if you could help clarify:

I saw on another thread Unable to use merge request decoration - #7 by Alexis that they were only able to get the MR annotations working after they took out all the -Dsonar options when running the CLI scanner. I went and removed these options and put all of them into the properties file and was able to get the MR annotations. However, I set up another project in Gitlab but left the -Dsonar options in this project but the MR annotations didn’t work. The setup, and integration is the same between all the projects, except the presence of these -Dsonar options. Is there some truth to this thread, or was there something else I was missing?


I’m happy you worked through your initial problem.

We try to keep it to one topic per thread. Otherwise it can get messy, fast. I believe the location of the parameters (command line or properties) is a red herring. If you’d like to dig into this, please create a new thread with all the details, plus your analysis log.