-
Notifications
You must be signed in to change notification settings - Fork 81
Feature/workdir fix master #171
base: master
Are you sure you want to change the base?
Feature/workdir fix master #171
Conversation
kingoleg
commented
Dec 21, 2017
- Updated version to 1.4.0-SNAPSHOT
- Added some more logs
- Exclude issues not related to PR Diff
- Fixed slf4j test binding
The motivation: Sonar discontinued the "incremental" analysis mode. So now we how only "issues" analysis mode. The difference between the mode is that "incremental" check only added/changes lines. Where "issues" mode is full code scan just without storing issues to a sonar server. It means, that if there is a file A with sonar issues in a branch, and I create a PR the branch with adding other file B without issues, sonar "issues" mode still will return issues for A. But as A is not a part of the PR, we are not interesting in this issue. So we should skip all issues not related to files in PR diff. Note. |
Hi @kingoleg, I'll take a look at it. One note about 3): |
Regarding 3) Please check the motivation comments. |
To clarify: In the situation you describe, you want to merge |
Always ignoring issues outside of the diff will still lead to problems when changes to one file affect the issues of another file.
|
I agree with you, that it can be some unreported new issues because of this. But it can be in any case. For example, I have a PR where an issues on new added line is reported by sonar as not new issue. Sonar just creates the same issue.key as has an other issue on the same file but for not touched line. Or, for example, I have a sonar java check that is completely ignored on sonar.analysis.mode = issues but reported fine on full branch sonar review. So, I have no doubt that only sonar PR review is enough to avoid new sonar violations. The issue that I have, the target branch can be changed after full sonar scan and then PR branch review scan can see the issue related to a file that is merged with other PR, but sonar will still report this file and this issues. And this is mistake. I cannot guaranty that when sonar PR review is started, the target branch sonar full scan is done and the branch is not changed after |
Hi @kingoleg, sorry for the long delay. About your two points:
If a check only runs in full scan mode, then it there should be no false positives with sonar-stash. I understand your issue with the ordering and configuration of the scans. However in my opinion this should be addressed by the system managing the scans in the first place. Any workaround in sonar-stash will be limited to sonar-stash. It will break apart as soon as you want to use more plugins. In contrast the workaround will lead to unexpected behaviour for users whose setup is "correct". |