SonarQube shows 0% coverage and the "Coverage on New Code" condition fails, although tests pass
IntermediateTroubleshootingSAST, SCA and secrets scanning in CI
Answer
Likely causes → The coverage report is not produced, is produced after the scanner runs, or the path property is wrong (sonar.javascript.lcov.reportPaths, sonar.coverage.jacoco.xmlReportPaths, sonar.python.coverage.reportPaths). Paths inside the report do not match repo paths (containers, /app/src).
Diagnose →
ls -la coverage/lcov.info target/site/jacoco/jacoco.xml
grep -m3 '^SF:' coverage/lcov.info
Check scanner logs for Could not resolve N file paths.
Fix → Run tests with coverage first, point the property at the file, and rewrite paths if tests ran in a container (sed -i 's#/app/#./#' coverage/lcov.info).
Prevent → Keep scanner config in sonar-project.properties in the repo and fail the job if the report file is missing.
More on SAST, SCA and secrets scanning in CI
gitleaks fails the PR on `tests/fixtures/fake_rsa.pem` and `testdata/aws_creds.json`, which only contain dummy valuesBeginnergitleaks passes locally but the CI job reports 40 old leaks nobody touched in this PRIntermediate`fatal: ambiguous argument 'origin/main..HEAD': unknown revision` in the secrets-scan stepBeginnerSemgrep flags `subprocess.run(cmd, shell=True)` in a script where `cmd` is a hard-coded constantBeginnerSemgrep in CI reports findings in `node_modules/`, `vendor/` and minified `dist/*.js`BeginnerSemgrep job takes 35 minutes and gets killed with `exit code 137`Intermediate