- versions used: SonarQube Version 8.6 (build 39681)
- error observed: Component key length (402) is longer than the maximum authorized (400)
- steps to reproduce: Scan a project with a short name, but with a very deep nested directory structure causing a the full path name, when combined with the project name and a colon, to exceed the 400 character limit.
We are running a quite recent build - Version 8.6 (build 39681) and experience the same issue as reportedly fixed Component key length is longer than the maximum authorized (400).
The project name we use is quite short, but some projects have a very deeply nested directory structure causing a the full path name to exceed the 400 character limit (when combined with the project name and a colon).
We are using a naming convention for the project name, to keep it unique and allow reporting issues in separate branches. I was thinking of hashing that string to use as a project name, but it will still not overcome the issue of the pathname concatenation, for which I have no control (any developer can create arbitrary long path names).
Would it not be possible to store the hash of the folder structure, instead of the entire string, as the postfix of the component key?
What do you suggest would be a possible workaround for this?