[10.3] Sonar Scanner - not using projectKey for project name from branch

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    10.3.0.82913 Enterprise

  • how is SonarQube deployed: zip, Docker, Helm
    Helm

  • what are you trying to achieve
    SonarScanner - passing and setting up projectName value from sonar-project.properties' file and branch other then main`

  • what have you tried so far to achieve this
    Performed multiple tests with usage of projectKey only, combination of projectKey + projectName

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Prior to version 10.2, when projectKey was set in sonar-project.properties file, and running Sonar Scan, projectKey value was used as default for new project name. Note: it was working on branch other than main.
Last time we did the upgrade to 10.3 and noticed, that this is not working any more.
Tried to use projectKey and projectName set both, but project is still named by repository name. Only after doing merge to main, project name is changed accordingly to value set by projectName.

Question: Removing the option for using projectKey as project name from the branch is a bug or feature?
Can we expect this functionality will back in next release?
To be honest, this caused a lot of mess in QA processes, some additional work must be done to change the project name manually (before merge) to be aligned with corporate naming conventions.

Looking forward for reply. Thanks

Hey there.

I’m surprised you’re running into this now because as far as I’m aware this behavior last changed between SonarQube v6.7 LTS and SonarQube v7.2 – and for a long time we’ve considered this a feature, that the main branch should be the source of truth for the project name.

Are you speaking about the very first analysis of a project, or later analyses?