Scan not working on pull request and warnings in sonar scan report

I am new to the Sonal world.

Sonar: 4.5.0.2216
SonarQube Scanner: 3.3.0.1492
Gitlab

I have two issues. I assume both are related.

  1. Sonal rules are not getting validated for Pull request (merge request code scan).
    the scan is working on branch’s and able to see the code smells. but the scan is not getting executed for pull request.

  2. When i verified the sonar scan report on pull request. I have noticed a warning.
    Warning: Could not find ref ‘development’ in refs/heads, refs/remotes, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and change.

I have verified the ref in Git. the branch is available.
8eb7bbb4bb3a06f83f7223a04f0b28f0f8d55d5c refs/remotes/origin/development

Can anyone suggest way to fix avove issues

Hi,

Welcome to the community!

Could you double-check your SonarQube version? You’ll find it in the page footer. I ask because SonarQube 4.5 is 8 years old and very out of date.

 
Thx,
Ann

Hi Ann,

Thanks. Yes it is not 4.5.
The version is 9.4 (build 54424)

Thanks,
OS

Hi OS,

Can you also verify that you’re using a commercial edition of SonarQube? Because PR decoration isn’t available in Community Edition.

If you are, then this is probably about your checkout. Are you doing shallow clone? This may be relevant:

 
HTH,
Ann

Hi Anna,

Yes, we are using commercial edition.
The warnings are gone after adding the GIT_DEPTH.

Thanks Ann, I will get more information on the 1st issue.

Thanks,
OS

1 Like

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