Onboarding new projects with DevOps Platform Config

Hi, I’m using sonarqube 10.1 enterprise edition and one of my users is building their system logic with the following goal:

  • sonar-scanner should auto-create the project if the project does not exists
  • the new project should have a custom quality gate
  • DevOps Platform Integration should be configured when the project is created (to enable PR annotation).

Sonar-scanner now is fully capable of creating the project and it works great, but people need to click click click click in order to configure DevOps Platform Integration settings and have their quality gate.

What is the config we need to run on sonar-scanner to auto configure the project with the settings above?


Welcome to the community!

It’s not possible to choose your quality gate from the analysis. It must be configured server-side.

Your best bet here is to provision the project before the first analysis. No, you don’t have to do it via the UI, you should be able to script that. Then as part of that provisioning script set the project’s Quality Gate.

I know this gets away from the “just analyze it, it’ll work” that you’re probably after, but it’s the best I can offer.

BTW, would you mind explaining more about the Quality Gates? I’m curious why you can’t just set this alternate Quality Gate as the default. Or is it that different projects need different Quality Gates?