I am using SonarCloud and it is connected to the organization (AzureDevOps).
When I try to add a new project to SonarCloud:
I go to the plus sign and then a list appears with the repositories from AzureDevOps.
The issue that I am facing is that not all the repositories appear on the list. I am trying to understand what is the condition from when a repository shows up VS when it doesn’t, but I still can’t identify the reason/condition.
Is this a bug? What could I do to see all the repositories? Is manually importing the only thing I can do for the missing ones?
Any help is really appreciated.
We don’t have any condition on our side, we just rely on the token you provided to list the repositories, using the list repositories API provided on AzDo. Is there some kind of specific/granular permission set on your repositories that you don’t see maybe ?
Hi Michaël, it could be that. I’ll troubleshoot with the AzureDevOps admin and see if that fixes this thing. Thank you.
Hi @mickaelcaro . We are still having this issue and we don’t see major differences in terms of permissions. Does the service SonarCloud use to pull the repositories have a max number of results(repositories) restriction?
We have a big number of repositories within our organization.
Ah, indeed, that might be that. i think we pull only the first 100 results or so.
I see. @mickaelcaro any way to pull a repository that doesn’t come from the list?
Not for the moment, we have a ticket opened internally to address that, but no ETA to give you yet.
Sorry for the inconvenience.
Hi @mickaelcaro. I have two questions for you on this topic.
- Any updates on the ETA? In our organization, we have close to 1000 repositories, and not having the wizard option could be a deal-breaker for us.
- Is there any difference in SonarCloud functionality by importing a project manually vs through the wizard?
No update on the ETA : but i think the biggest problem we’ll face here is that the API we call to retrieve repositories is not paginated, so not sure if we can figure this out right now, we’ll have to check with MS support directly.
The only difference will be that your manually created project’s won’t benefit from the organization-wide PAT for PR decoration, meaning that you will need to put a PAT on each project’s setting. Apart from that, this is pretty much the same experience.
Is this issue fixed? Same issue here? Azure DevOps - importing repo - cannot see specific project's repos - #7 by TomVanBraband
We are in a test phase for using SonarCloud. Our organization has aprox 170 projects and 450 repos.
SonarCloud imports only 212 repos, so a lot is missing. I can’t find any (azure) user policy causing this.
I can manually create projects as proposed, but its a work around…
In Azure devops api you might set a max return count.
I would guess the default value, max 100 projects, is to small for a lot of organizations using “paid plan”.
Hi @endre and welcome to the community.
Projects are now paginated, so you should normally see them all in the list.
Concerning the repos, that’s another story, we’re currently reviewing which kind of solution we can come up with, since the API doesn’t offer such possibility.
Thx for the reply, but…
Only 58 of 170 projects are listed. So 2/3 of our projects are not listed.
Any idea why?
Pagination looks like a UI feature, as only one request to list_repositories is submitted.
I guess we can manuelly set them up, but is a workaround and SonarCloud does give a warning. And all users are new and unknown to SonarCloud.
Manual setup is not recommended, and leads to missing features like appropriate setup of your project or analysis feedback in the Pull Request.
We do have aprox 450 repos from 170 projects in Azure DevOps.
SonarCloud only lists 212 repos from 58 projects.
Hi @mickaelcaro, I upgraded our plan to paid plan hoping all projects will be listed, still no luck, see lists from SonarCloud and Azure DevOps below.
Is there any specific permission or setting I can check to enable all projects to be visible on SonarCloud?
SonarCloud is using a PAT from my account will Full Access.
Does those projects belongs to the same organization on Azure ? Or you are “invited” to some of them ?
Yes, I only have one organization on Azure and I am the organization owner.
Same here, seems like only 100 projects are shown… and the other nothing!
We finally found the issue and fixed it.
Can y’all confirm that you’re seeing your list of projects correctly now ?
@mickaelcaro - I see the missing projects now! thank you for this fix.
I am still experiencing this issue of missing projects and repositories. Is there something we need to do on our side to get things to work ? The projects have been setup for a year or two already, before the fix mentioned in this thread. We now have a larger number of projects & repos connected, and the ones from before (and new ones) now cannot be found.
@mickaelcaro I am experiencing this issue as well. I am running 9.4. I see exactly 100 repos listed and when I search and check the network tab I can see the response contains the list of repos I would expect, but they do not show up in the list on the web page. You can see from the screenshots below that the web page shows only 1 result while the response returns 9 repositories.