Open SMUnlimited opened 7 months ago
What length is your project key on an impacted project? Sonarqube project IDs (as sent to Bitbucket) are based on the project name plus a homegrown UUID-style identifier (this switched to an actual UUID in 10.4)
Sonar Project Key: 66
Broken down into the maven properties sonar auto creates project key from: GroupId: 40 ArtifactId: 25
Note sonar UI says project key is legitimately allowed to be up to 400 characters long.
Describe the bug Following error occurs after sonar scan on a PR linking to bitbucket. No annotation on the bitbucket PR. Note the scan itself works fine, just the annotation fails with error below. Other repo's and branch PR's seem to work fine.
To Reproduce Not sure what
key
specifically is too long, but I suspect the report key itself is over 50 characters? I guess this is not configurable in uploadReport method.Looks like this is just ultimately the project key, which yes the project key is over this many characters as its a maven project so automatically pulls in the groupId:artifactId which can be long.
Expected behavior PR annotation occurs, or it does not but we can configure the report key as part of the scan so it comes under this limit.
Software Versions
Workaround We can override the project key using
sonar.projectKey
property, after using the sonar UI "Project Settings -> Update Key" to change the project key to desired shorter ID.