Projectkey without organization name in SonarCloud

Hi! I have a doubt with SonarCloud and import projects from Github through an organization.

The question is that when I import a project from Github to Sonarcloud since the UI, the project key is always as: organizationName_projectName.

For example, if my organization name is: apple, and my project name is: generateiphone, when I import my project from Github to Sonarcloud, the projectKey will be: apple_generateiphone

My question is: There is some way to avoid the organization name in the project key?

Thanks!

Hey there.

It’s not possible to change the key before the project is created – it is possible to update the key after the project is created by going to the project-level Administration > Update Key

Out of curiosity, why do you want to avoid the organization name in the project key?

Thank’s for you quick response @Colin !

We want avoid the organization name because we only have one organization, and doing it, we can match the Github project key with the Sonarcloud project key.

Thanks. Just so you know – project keys are not scoped to the organization level (a project key can be used once on all of SonarCloud). Theoretically, you could still run into cases where the two can’t match because one is already taken.

So, if I have a paid account with several lines of code, is it possible for someone from outside our organization to create projects with the name of our organization (for example “organizationname_projectkey”) and thus match the password, thus preventing us from importing projects?

No. Only projects belonging to your organisation (which is not controlled by project key) will count towards your license utilisation.

Hi @Colin

Here my explain maybe wasn’t clear, sorry. I want to said that if one person that know my organization name, could create a project with the key +project1 (is an example) avoid that I in the future, can create a project with the same key although this key begins for the name of my organization?

I understand that if I have a payment account, nobody can create a project with a key that begins with the name of my organization. Is this true?

Hey there.

Nothing prevents somebody in another organization to change their project key so that it begins with your organization key (and I don’t think that’s unreasonable – imagine if there’s an apache organization key but somebody creates a project called apache-maven-examples) – but it will have no impact on your billing or the projects you see on SonarCloud.