ALM : GitGub
CI system : On Prem Jenkins
Scanner Command : mvn sonar:sonar -B -s modules/XX/Maven/Build.xml -Dsonar.login=**** -Dsonar.pullrequest.key=XXX -Dsonar.pullrequest.branch= -Dsonar.pullrequest.base=main -Dsonar.pullrequest.provider=GitHub -Dsonar.pullrequest.github.repository=our-org/projectname
Language : Java / javascript
Recently we migrated the our project repo to GitHub & also started using the SonarCloud. The build is running ran using on prem jenkins. As part of PR build process (on Jenkins slave), we invoke sonar scan using MVN. This pushes the scan results to SonarCloud. To reduce the build time we are not running the sonar scan in main build. Instead we have a separate jenkins job (not part of build) which run a full inspection on main branch every 2 hours.
What we have observed that for many PRs (but not all), the files pushed as part of PR & files listed as part of SonarScan results are not matching. Many a time we are seeing additional files & the pushed files are not listed.
In ideal scenario the files pushed in PR & files idetified in SonarScan should be the same. This post challenge in code coverage etc.
Could you please help us here to fix this issue.