Making project keys unique per organisation

We are using SonarCloud tasks in Azure Pipeline to create and analyze our repositories.

While creating a new project and tried to analyze it, the SonarCloudPublish task returned a


##[error]ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator to check the permissions of the user the token belongs to

We invested a lot of time in this issue until we tried to create manually the project in SonarCloud. There, we got the following message: Could not create Project, key already exist: app-service

Based on the following topic, it seems that the project keys are global to Sonarloud and not on an organisation scope.

Why I open that ticket:

  1. While the errors are both relevant, the first that we got is misleading. Is there any chance to make it more clear for future case?

  2. Being limited in the projects that we can create is a pain as this might hit us late in the project creation process. Is there any plans on making the project keys unique at an organisation level?

Hi,

Welcome to the community!

These are great points.

Probably not. I think the theory is that this 404 message is more secure than admitting that the project key is already owned by someone else. (And yes, the clear message you get at project creation kinda takes the wind out of this sail.)

Again, very fair point. I’ll raise this internally, but I’ve seen few complaints about this in the last 5 years. So I doubt there will be any movement on this any time soon.

 
Ann