Closed datasmurfen closed 6 years ago
Did you perform a full scan beforehand? It should definitely add a comment on your PR. Do you have a multimodule layout?
The overview comment is not being reset currently.
Yes I ran a fullscan by manually trigger this command mention below by sending in the PR id manually for now from the command line.
Could you please clarify what you mean about "multimodule layout"?
branch=$(git symbolic-ref --short HEAD) repository="${PWD##*/}" mvn sonar:sonar -Dsonar.projectKey="$branch" -Dsonar.analysis.mode=issues -Dsonar.stash.comments.reset \ -Dsonar.stash.notification=true -Dsonar.stash.project=X-Dsonar.stash.repository="$repository" \ -Dsonar.stash.pullrequest.id=$1 -Dsonar.stash.password.variable=SONAR_STASH_PASSWORD
Do both your full scan and the PR scan use the same value for "sonar.projectKey"?
How does the layout of your source code look?
In case it is non-trivial (sonarqube modules, mismatch between git root and sonar project root) use the setting sonar.stash.repository.root
Aaaa. No it doesn't for the being. In the script i use branch name, and in the full scan triggered by auto-build environment I use maven.project.artifactId (projectname) . Perhaps that is the problem, and I have to set project name in script?
src/integration src/main src/test
Well, this key has to match. If you don't specify anything the sonar maven scanner will pick up your projectKey from maven. Whatever you use, just use it consistently.
The multi-module part is relevant when you have multiple maven modules (pom.xml)
Not in this current project I am testing with now. Things went better after changing the project key 👍 So please tell me what I need to do with the projects with multiple pom.xml files?
The settings is sonar.stash.repository.root
, documented in the Readme
Include Existing Issues setting. This setting is turned off by default. Either way - I still got a long list in the overview comment section about things not related to my PR - is this expected behaviour?
From the console it seems like it's trying to push a comment as well on those files. [INFO] Comment "xyz" cannot be pushed to Stash like it does not belong to diff view - x.java (line: x)
Also when there is a issue introduced in a PR - it doesn't seem to publish a comment on that line either? I have tried to make new issues you see 😄
EDIT: Also the: sonar.stash.comments.reset - doesn't remove the overview comment?