How to start the scanner from now and not pick up all existing issues?

Hi folks!

I am working on trying to implement Sonarcloud on our open source repo on GitHub.

I have been following the steps to get this working on a PR from a forked repo which is how we accept contributions - see How to use SonarCloud with a forked repository on GitHub? - #34 by RCheesley for the relevant files and steps I have taken this far.

I now have it working in that it’s running the checks and is pulling in the code coverage report from Codecov, however the report itself seems to be pulling up all the current issues with the whole codebase rather than just the things from the PR itself.

I am not sure if this is something that I have misconfigured in the settings and would appreciate a nudge in the right direction, as this is the last piece in the rather long-running puzzle that is getting SonarCloud deployed!

Thanks in advance!

Hey there.

I saw this in your GitHub actions logs:

INFO: SCM Publisher is disabled

This will prevent the detection of changed files / changed lines. I couldn’t find this setting in your repo – maybe you have it configured in the UI? Check your project-level Administration > General Settings > SCM

1 Like

Thanks for the super speedy reply @Colin - just re-running against a PR with that setting turned on, sounds like that might be the missing link!

Hmm, it is still showing the same report:

I checked and it looks like it should be enabled:

I tried also setting the provider as git but that made no difference - maybe I need to explicitly declare it in our properties file or in the command itself?

Update:

Still getting stuck here!

Set in the UI to be enabled, also set it in the project settings file:

When the action runs it is still showing that SCM is disabled:

Any ideas or anything obvious that I am missing here @Colin ?

To be clear, you want sonar.scm.disabled to be set to false in all places – and a sonar-project.properties file will override anything set in the UI, so I would suggest removing it from your sonar-project.properties file and restoring your settings in the UI to the default.

I believe it is set to false in all places - in the UI, in the project settings file (see screenshot above where it is not selected in the UI - assuming that to mean false and green to be true, as in, turn this on if you WANT to disable the sensor - and in the project settings file it is explicitly set to false).

It’s set to true here:

It looks like you may have accidentally declared the property twice in sonar-project.properties

Ahhhhh, :woman_facepalming: that would do it! Just removed that line, hopefully that will sort it out! Thanks for pointing out the mistake!

That was it! Thanks!

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