coolhand79
(Luke Chambers)
October 26, 2022, 10:10pm
1
Using sonar-scanner in codebuild, I’m getting scan results to appear in SonarCloud, but they are not found under the pr’s destination branch (in this case, master
)
I’m running like so:
sonar-scanner -Dsonar.host.url=https://sonarcloud.io
with a sonar-project.properties file like so:
sonar.projectKey=<project key>
sonar.organization=<org name>
sonar.projectName=<project name>
sonar.host.url=https://sonarcloud.io
sonar.sources=./src
sonar.tests=./test
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
Thanks!
Colin
(Colin)
October 28, 2022, 10:04am
2
Hey there.
I don’t quite understand what you mean – can you explain further, perhaps sharing screenshots as well?
coolhand79
(Luke Chambers)
October 28, 2022, 4:22pm
3
Hi Colin, sorry, that might have been a bit confusing:
We run sonar-scanner for github pull requests.
What I expect to see is:
The results of the analysis under Pull Requests within sonar cloud. Instead, I see this:
I expect to see the PR annotated within github (like the following image), but I do not.
I hope that helps!
Colin
(Colin)
October 31, 2022, 1:09pm
4
Okay! I assume you’re running the build through GitHub actions (correct me if I’m wrong)
Can you share the GitHub Actions YML file?
Do you see a SonarCloud analysis run in the context of your pull request build on GitHub?
coolhand79
(Luke Chambers)
October 31, 2022, 7:05pm
5
Actually, I am running them through AWS Codebuild.
Colin
(Colin)
November 1, 2022, 9:13am
6
Thanks for the clarification.
In that case – to run analysis on pull requests (since AWS CodeBuild isn’t supported out of the box), you’ll need to specify that on pull request builds a few analysis parameters are added:
Typically these are derived from environment variables.