Azure Devops PR decoration on files that are not in my PR

Hi,

i have a PR with minimal changes. But the PR gives me issues in files I have not changed at all.

All issues shown were just introduced by another PR in the meantime (we do not have a strict policy to fix all issues). The master build (aka sonar.pullrequest.base) did not run yet (nightly build).

Can we make the decoration check that it only reports on file (or better lines!) that were really changed in the current PR?

SonarQube Enterprise Edition Version 9.9.1 (build 69595)
SonarScanner 4.7.0.2747

Note:
Today I can confirm my suspicion: After rebuild the unrelated issues are gone. Nightly build ran.

Hi,

Typically when you see unrelated issues reported in new code / on a PR, it’s a problem with the detection of new code. Your issue has disappeared, but if there’s a next time, you’ll want to look at (the end of) your analysis logs to see if they say anything in particular about SCM detection. Beyond that, it may be that the first time analysis ran, the branch being targeted by the PR wasn’t available in the local SCM repository.

 
HTH,
Ann

1 Like

You are correct. It said:

INFO: SCM Publisher is disabled

After enabling it said:

INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 14 source files to be analyzed
INFO: SCM Publisher 14/14 source files have been analyzed (done) | time=667ms

And then, foreign issues are not reported in the PR.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.