I have three projects in a monorepo. Each is configured almost identically. Two show their project name in PR comments. One does not.
The project name is explicitly set in
And it appears correctly in the SonarCloud UI.
How do I get the project name to appear in the PR comments?
The project name should appear if the repository is configured as a monorepo. Try hitting the following Web API with your different project keys to see if they are configured well or not.
If a project was not bound to a monorepo on setup, you’ll need to create a new project that is added to your existing monorepo project set (that I assume your other two projects belong to)
Importing a monorepo
- Go to the
+ (plus) menu on the top right of the SonarCloud interface and select Analyze new project .
- This will take you to the
- Now click Setup a monorepo (it is a small text link on the lower right of the page).
I don’t feel the docs are very clear about how to add projects to an existing monorepo, and that you cannot add an existing project to an existing monorepo (only a new project can be added to an existing monorepo). I’ll ping internally on this.