We have a problem when doing the SAST scan because when I tried the coverage testing locally in my IDE, the coverage is 100% but when I push it in github to the master branch and check the SAST result, I got 0% coverage. But the strange thing is that it didn’t happen to all push, only some. The line of code I added was 5 lines. Can you help me with this?
I’m using Java for the development of the code and Github for the Devops.
When checking the SAST result, there is a warning stated:
Could not find ref ‘master’ in refs/heads, refs/remotes/upstream or refs/remotes/origin. You may see unexpected issues and changes. Please make sure to fetch this ref before pull request analysis.
But the thing is, I push my code from my personal branch itu master branch and i already fetch it before. Can you help me with this?
Yes I sent the analysis report to SonarCloud and this happens only on certain pull request not all pull request even though the configuration is the same for all pull request.
This below is the screenshot for the coverage report on my SonarCloud dashboard
To be clear, you get this result even after making sure the prerequisites are in place and re-analyzing?
And if so, can you share your 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.