Initially I set up with 6 projects that were under my monorepo. All worked perfectly.
Fast forward a week, I now have a seventh project inside my monorepo that I want to add to my existing monorepo that I created. But I am not able to find any obvious place in the UI that allows you to do that.
If I click “Add new project” – those projects created will be bound to the monorepo, like the other 3 I already linked to this repo (colin-sonarsource_test-repo-java, colin-sonarsource_test-repo-java_1, colin-sonarsource_test-repo-java_2)
Just one further observation. My information box doesn’t show all linked projects like in your screenshot. It just shows one of them i.e. it says “Repository already imported and linked to the xyz project on SonarQube Cloud” where xyz is an arbitrary repository of those 6 I initially linked.
This is weird because each one of those 6 Sonar projects seems to work perfectly fine.
I thought it was a small bug of SonarCloud but now your screenshot baffled me.
The results of the API call come from https://sonarcloud.io/api/alm_integration/list_repositories?organization=ORG_KEY. Do you only see the one linked project for the repo in question? Do you see those projects anywhere else in the response?
We build via Gradle (we run the sonar scanner via the Sonarqube gradle plugin).
I think that’s what you were asking, but just for the sake of completeness: the gradle command itself (we use the gradle wrapper) is run as part of a Jenkins stage (via an sh step). The Jenkinsfile, wrapper and build scripts are all in the git monorepo in Bitbucket (which we use only as a VCS).
In the monorepo we have a multi-project Gradle build, each subproject declares its own sonar.projectKey property under sonarqube { properties { } }.
Bitbucket was what I was looking for. And indeed, I can reproduce the behavior with Bitbucket (I could not with GitLab or or GitHub) when going back to add more proejcts to an existing repo I’ve provisioned as a monorepo with multiple projects.
So this looks like clearly a bug on our side. I’ve flagged it for attention.