Set up for domain driven repository

Hey, in case someone has this issue in the future, here are my findings.

It’s possible to set up multiple SonarCloud projects for single repository, one for each folder. The first project for the repository needs to be set as monorepo in the UI. Subsequent projects should have the monorepo checked already on creation.
In each folder create sonar-project.properties file. No need for properties file in the repository’s root folder. The properties file must contain sonar.projectKey= and sonar.organization= that match the project set in the UI. From there each project can set their own preferences. One sonar cloud token can be used for all projects.

In our case, we wanted to also use coverage. For that we used settings sonar.javascript.lcov.reportPaths=../path/to/coverage/lcov.info. This also required to have the SC jobs running after unit tests finish.

Additionally, we found turning off comments valuable. It must be done in UI - Project page > Administration > General Settings > Pull Request > uncheck the option Enable summary comment as described here. Attempts to configure this in properties file failed.

What was most confusing is to find out which configuration should be set in UI and which in properties file. Ideally configuration should override UI, allowing declarative, more of an infrastructure as code approach.