So if I understood correctly, we can setup a specific quality gate for each app, and that I managed to create. I have now 3 project keys one for each app.
Following the github actions tutorial it have to create a ./github/workflows/build.yml file and thats fine, but then it ask me to create one sonar-project.properties on the root folder
The problem is that I have 3 different apps, and only one sonar-project.properties file, so how can I match the specific app with the specific project key?
You’ll need to have a different sonar-project.properties file for each app, and then set the base directory for each separate scan. Take a look at the example here:
The sonar-project.properties that you place in the root directory of each app (the base directory you are configuring for the scan, not the whole repo) will contain a sonar-project.properties file each with a different project key.
That really depends on how you’ve configured your build – when you change the code in one app, do all of your apps build?
If so – then yes, scans will run for all three projects and a Quality Gate will be reported for each application. However, if no code changed in the other apps, those Quality Gates shouldn’t change.
so if I configure my action with with: projectBaseDir: apps/app-1/ then if I understood correctly only the contents of this folder will be taken in consideration right? and then inside that folder I have the sonar-project.properties that then will inform sonar cloud which quality gate to use.
maybe apart from those 3 steps (actions) i need to create a default one without projectBaseDir and then configure my monorepo again with a root quality gate excluding the apps/ folder