Can Sonar qube report code coverage difference to AzureDevOps pull request? - azure-devops

We setup Sonar qube pull request decoration in AzureDevOps.
It report code issues and analyze status to pull request. Also code coverage gathered and can be viewed on Sonar site. Diff coverage also calculated correctly.
But is it possible report coverage back to pull request, so reviewer can take look on difference not leave pull request page? I see on different screenshots, that for github it is possible. But is it possible for AzureDevOps?

We cannot do this now, In the azure DevOps, we could see the Sonar report in the Sonar site.
You could add your request for this feature on our UserVoice site, which is our main forum for product suggestions. And produce team will check the request. Thank you for helping us build a better Azure DevOps.

Related

Showing Code Coverage Report with Azure DevOps

I'm using Microsoft Unit Tests to validate my solutions via Azure DevOps Pipelines. I am able to see tests being executed and the % of code coverage
However, I can't see the code coverage results (or they won't render)...
Here is my publish code coverage task - am I missing something to have it render here?
This is a known issue on Azure devops. Now, we could only download the report, and open it with Visual Studio.
Azure devops only support the download link for .coverage files currently. The white page you see is a UI glitch. This scenario is only supposed to render a download link to the coverage file.
Besides, this issue has been submitted in this earlier suggestion ticket linked here:
support vstest .coverage "code coverage" build results tab
This feature request is On Roadmap, I believe it will be released soon, you can follow this thread to know its latest feedback.
In addition, we found a similar case and I have tested via the answer, set the code coverage tool to Cobertura, then I get the code coverage report in the Azure DevOps pipeline.

How to synchronize issues between SonarCloud and TFS

I have a VSTS repo connect to SonarCloud for quality analysis.
I need unique issues source for my team.
When SonarCloud create issues in his system, I want create an equivalent issue in VSTS.
And, when the issue in VSTS closed by a commit, I want close SonarCloud issue.
Can you help ?
Same question with GitHub...
Thx
Although there are issues created during an analysis in SonarCloud, the result is passed. So it won't create bug work item for such builds in VSTS.
The SonarCloud extension itself can not achieve what you want, one workaround here is using SonarCloud api and VSTS REST API to implement your own solution.

How to prevent the pull request integration for SonarQube to report issues as inline comments on Githuib?

I configured SonarQube analysis to report it's status to pull requests on my GitHub project. SonarCloud already supports pull requests as first class citizen as described in https://blog.sonarsource.com/sonarcloud-loves-your-build-pipeline. As I understand, this kind of integration is not using the GitHub Plugin for SonarQube.
The configuration provides these properties (look here for the complete configuration)
sonar.pullrequest.provider
sonar.pullrequest.github.repository
sonar.pullrequest.branch
sonar.pullrequest.key
The credentials for the technical user are set in the SonarCloud project administration.
You can see the results here: https://github.com/BudgetFreak/BudgetFreak/pull/86#pullrequestreview-125364230
Every issue is reported as an inline comment, one summary comment is made and the status is reported for the code-quality/sonarqube check.
I would like to disable the inline comment on every issue. This was possible using the GitHub plugin. Can this also be achieved with the new pull request integration?
Unfortunately, on SonarCloud, this feature is not available.

can SonarQUbe do a full analysis on a github pull request?

I'm looking at integrating Sonarqube with our github instance. the one issue we're having is that SonarQube only supports preview analysis with Github currently, as opposed to a full one that includes code coverage. What we would ideally like is for SonarQube to do a full analysis of each pull request, and then post the outcome of this back to Github as a Github check. Is this possible?

How to report code coverage in Github Pull Requests using Sonar Github plugin

I have SonarQube server 5.6 and I am using Github. I have done the integration to setup Sonar Github plugin but I fail to understand whether this should report if the new code does not meet the code coverage threshold setup in the Quality Gate.
In the Quality Gate I have defined an error to be raised unless there is more than 75% code coverage for the new code that is being introduced by a Pull Request.
Should the Sonar Github plugin report an issue (comment) in Github pull request if the new code added does not meet the Quality Gate metric that I setup?
Is there any way to mark in Github Pull Requests if the new code trying to be merged does not meet the coverage expectations?
Thanks!
Pull request analysis cannot currently raise all types of issues. Specifically it cannot raise issues related to metrics because those are consolidated on the server side during analysis report processing and in a Pull Request analysis the analysis report is by design never submitted to the server.
EDIT The PR analysis which is offered as part of the Developer Edition($) does both decorate the PR in the provider (e.g. GitHub) and show the PR on the server. However, metric-related issues still don't show up in this enhanced analysis.