Pull Requests are not visible in SonarQube dashboard?

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    • SonarScanner for MSBuild 5.5.3
    • SonarScanner 4.6.2
    • Using the .NET Framework version
    • SonarQube server 10.2.1, Developer version
    • On-Prem
    • SQL DB, Azure DevOps Server, and SonarQube server run on VM(Windows 2019)
  • how is SonarQube deployed: zip, Docker, Helm
    • zip
  • what are you trying to achieve
    • Issue with Quality Gate in Azure DevOps pipeline
    • Pull Requests are not visible in SonarQube dashboard.
    • SonarQube Quality Gate is not coming up in Status Checks
  • what have you tried so far to achieve this
    • setup ALM Integration on project level and in administration panel
    • Create a new PAT
    • delete the project and re-configured
    • run a multiple PR analysis for SonarQube to emit that Status which still not populating
    • are using Azure DevOps CI pipeline yml to trigger the analysis (SonarQubePrepare@5…)
    • it runs and detects new lines in the new code but not stops the pipeline, and not provides an analysis on the SQ dashboard. Can’t even see branches that PR’ed In the dropdown(top-left) where it is says master (main)

Hi,

Welcome to the community!

There’s a lot going on here, and we try to keep it to one topic per thread. Otherwise it can get messy, fast. So let’s concentrate here on

First, is the project itself showing up as analyzed in SonarQube?

Second, can you provide a PR analysis log?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann

Hi Ann,

The project itself showing up, connection is configured. it shows that it is being analyzed everytime we have a new PR for feature branch and/or merge into developer branch in Azure Devops CI but I don’t see any changes in SonarQube.

I checked ce.log(PR decoration is success along with everything else) , web.log, es.log, access.log and everything seems fine. Unfortunately, I am on-prem, separete environment with no internet access.

Hi,

I’m not asking about server logs. Let’s start with the analysis log.

 
Ann

Hi,

even analysis log, it is in different/separete environment like 2 different computers with 2 different networks. I cannot copy and paste here.

there are couple warnings that I saw in analysis log:
Warn: Failed to find the code coverage command line tool. Possible cause: Visual Studio is not installed or the installled version does not support coverage
Warn: Incremental PR analysis: Could not determine common base path, cache will not be computed.Consider setting sonar.projectBaseDir property. This could be an issue?
Warn: The property ‘sonar.login’ is deprecated and will be removed in the future.Please use the ‘sonar.token’ property instead.

Thanks,
Evodia

Hi Evodia,

Feel free to redact your logs as necessary.

 
Ann

Hi Ann,

I even check SCM Publisher since analysis needs the SCM metadata. Here is what I have:
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 25 source files to be analyzed
INFO: SCM Publisher 25/25 source files have been analyzed (done)
INFO: Load New Code definition
INFO: Load New Code definition (done)
INFO: Analysis report generated in 1031ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://xxx.xx.xxx.xx:9000/dashboard?id=ProjectKey
but Do Not have the &branch=dev at the end.

What I dont have though:
INFO: Report issues: Starting
INFO: Report issues: Time spent was

Thanks,
Evodia

Hi Evodia,

I’m really not going to be able to help much without the full analysis log.

 
Ann

Hi Ann,

I understand. I am trying to find a way to transfer SQ analysis log from Network a to Network b. I’ll post it if I can accomplish that.

Thanks,
Evodia

I can share the background task id of the analysis if that helps.

Hi,

The background task id from your local server won’t help much, no.

 
Ann

Hi Ann,

Do I need to manually configure branch/PR analysis?

Thanks,
Evodia

I wish I was able to post the PR analysis log but when I compare my analysis which is in air-gapped network vs the analysis in commercial internet, there are things are missing on mine.
my analysis: loads the projects branches, quality profiles, active rules, analysis cache but dont see the branch name.
missing 2 INFO:
INFO: Found manual configuration of branch/PR analysis. Skipping automatic configuration.
INFO: Branch name: dev
INFO: Preprocessing files…

Thanks,
Evodia

Hi Evodia,

To be honest, at this point I don’t have enough data to have any understanding of what you should do.

 
Ann

what about ce.log which I still cant provide it to you here but I dont see pullRequest=xxxx in the log, and submitter is not admin or devops.
submitter=myusername and even I dont merge into master_dev, still looks like submitter is me.
is there any reason why?
Hypothesis: I log into Azuredevops with my username(Active directory) and set up devops with my username (admin priviliges) and SQ set it up as an admin.

Thanks,
Evodia

Hi Evodia,

The submitter is going to be the account that generated the token used in analysis.

 
HTH,
Ann

Hi Ann,

Thank you for your quick reply.

Is there anyway that you can share a screenshot where we need to configure in project settings and Administiration?

Thanks,
Evodia

Hi Evodia,

Configure what?

 
Ann

Under Projects settings and Administration, I only configured DevOps platform, and server base URL, besides generating token and etc. When I actually check the devops platform configuration in both places, it is valid. I just want to make sure I didn’t miss anything since Pull Request is not visible under Project Settings/ Branches & Pull Request (only Branches is visible).

Evodia

Hi Evodia,

Sorry, I don’t have anything for you.

 
Ann