hddbl
(HD)
September 27, 2023, 3:49pm
1
I’m executing the dotnet sonarscanner inside a dockerfile, in the pipeline the analysis is successful, could see the same in sonar cloud dashboard. But the results are not reflected in the azure devOps Pull requests status. Also tried setting quality gate wait though no help
dotnet sonarscanner begin \
/k:${PROJECT_KEY} \
/o:${OGRANIZAION_KEY} \
/d:sonar.host.url=${HOST_URL} \
/d:sonar.token=$(cat /TOKEN) \
/d:sonar.pullrequest.key=someid \
/d:sonar.pullrequest.base=master \
/d:sonar.pullrequest.branch=somebranchname \
/d:sonar.qualitygate.wait=true
Colin
(Colin)
September 27, 2023, 4:45pm
4
Hey there.
Take a look at this thread:
Hey @Plevi1337
Thanks for the details.
My understanding is that when the project is bound there should be data that’s always available to SonarCloud when decorating PRs. That data doesn’t seem to be there on the PR you shared with me.
This is data that is set also by the Extension for Azure DevOps (but only meant to be used when a project isn’t bound). That’s these analysis parameters and corresponding build variables:
sonar.pullrequest.vsts.instanceUrl - System.TeamFoundationCollectionUri
s…
For what it’s worth – we recognize there’s a bug here that is in the backlog to fix. In the meantime, you can populate these analysis parameters.
1 Like
hddbl
(HD)
October 5, 2023, 5:45pm
5
Hi Colin,
Thanks for the earlier suggestion. I applied the suggested changes and I am able to see the results in pipeline but not in the azure devOps pull request dashboard. Am I missing any configuration ?
We do we have other dotnet projects (not docker build), there the status is updated without any issues.
Colin
(Colin)
October 6, 2023, 10:47am
6
Are you sure that the values you’re passing (DEVOPS_URL, VSTS_PROJECTNAME_ SONAR_PROJECT_KEY) match exactly the values that the other post references?
sonar.pullrequest.vsts.instanceUrl
- System.TeamFoundationCollectionUri
sonar.pullrequest.vsts.project
- System.TeamProject
sonar.pullrequest.vsts.repository
- Build.Repository.Name
hddbl
(HD)
October 6, 2023, 5:53pm
7
Hey Colin,
I made sure the values are correct.
However in other projects, we use following pipeline tasks and not docker build
SonarCloudPrepare@1
SonarCloudAnalyze@1
SonarCloudPublish@1
Colin
(Colin)
October 13, 2023, 3:52pm
8
In those cases, you won’t need to use these analysis parameters at all, as the values get automatically populated.
Are you saying that the PR decoration also doesn’t work in these cases?
system
(system)
Closed
October 31, 2023, 6:28pm
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.