AmadeusITGroup / sonar-stash

Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
MIT License
165 stars 82 forks source link

Comment "015EBE59CB52384343" cannot be pushed to Stash like it does not belong to diff view - some/file (line: xx) #152

Closed vexdev closed 6 years ago

vexdev commented 6 years ago

Hello, I just encountered this issue on a multi-module gradle project. I think this happens because when multiple modules exists, sonarqube analises them one by one using the base path of the current module.

Example error: Comment "015EBE59CB52384343" cannot be pushed to Stash like it does not belong to diff view - app/src/main/java/file.java (line: 12)

Real location of the file as reported on stash: project/app/src/main/java/file.java

As a result, comments are not being pushed in the diff.

t-8ch commented 6 years ago

Hi @vexdev, which version of sonar-stash are you using? Are you setting sonar.stash.repository.root as indicated in the README?

vexdev commented 6 years ago

Sonar-stash release 1.3.0 Bitbucket Server version 4.6.0 SonarQube version 6.5

Setting sonar.stash.repository.root both to the absolute repo directory (With $PWD), to the relative project folder which is actually ../ and even to $PWD/../ but this did not help.

I actually am starting to feel that this happens because the project is not in the root directory of the repository (The project is in a subfolder) and sonar-stash can't understand this. Is there a configuration that I can tweak to fix this?

vexdev commented 6 years ago

Hold on, actually setting the root to $PWD/../ did fix. Thank you for hinting me to that setting.