chore(ci): refine SonarCloud config and coverage upload - #2985
Conversation
Combines the SonarCloud-relevant parts from ansible#2977 and ansible#2979: - Configure explicit LCOV report paths (coverage/lcov.info, coverage/wdio/lcov.info) so SonarCloud reliably imports coverage - Add packages/common/test/ to sonar.tests scope - Document long-lived branch pattern for SonarCloud without hardcoding sonar.branch.name/target - Reduce scanner log verbosity (debug=false, INFO, verbose=false) - Upload LCOV artifacts via ansible/actions/upload-artifact (gitleaks- secured wrapper) from build-and-test and ui jobs for SonarCloud - Ignore *.tgz packaging artifacts in .gitignore Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Codecov's default carryforward: true was merging old (pre-ansible#2983) inflated coverage data into new honest reports, causing coverage to jump from an honest 39% to an inflated 87% when late-arriving flag uploads triggered re-computation. - Set carryforward: false for all flags (unit-nodeXX, wdio, wsl-fedora) - Increase after_n_builds from 3 to 5 to match actual upload count (3 build-and-test + 1 wdio + 1 wsl) - Enable wait_for_ci so report waits for all uploads before computing Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Combines the SonarCloud-relevant improvements from #2977 and #2979 into a
focused, merge-ready PR, plus fixes Codecov carry-forward inflation discovered
during review. Credits @ssbarnea for the original SonarCloud work.
Changes
SonarCloud configuration (from #2977 / #2979)
(
coverage/lcov.info,coverage/wdio/lcov.info) instead of glob patterns —SonarScanner's wildcard handling for this property is inconsistent
(Copilot review on #2977)
packages/common/test/tosonar.tests(was missing)without hardcoding
sonar.branch.name/sonar.branch.target, which wouldbreak PR scans
DEBUG/verbose=truetoINFO/false—DEBUGis only useful when diagnosing scanner issuesbuild-and-testanduijobs viaansible/actions/upload-artifact@b2b0657c # v1.1.2(gitleaks-secured wrapper around
actions/upload-artifact).gitignore: ignore**/*.tgzpackaging artifactsCodecov carry-forward fix
After merging #2983 (honest coverage), we observed coverage jumping from an
honest ~39% to an inflated 87.67% after late-arriving WSL uploads triggered
re-computation. Root cause: Codecov's default
carryforward: truewas mergingstale (pre-#2983) inflated coverage data for flags that hadn't yet uploaded
fresh results.
unit-node22/24/26,wdio,wsl-fedora) — each flag uploads fresh data on every CI run, socarry-forward is unnecessary and was actively harmful
after_n_buildsfrom 3 to 5 to match actual upload count(3 build-and-test matrix + 1 wdio + 1 wsl)
wait_for_ciso Codecov waits for all uploads before computingthe final merged report
What was NOT included from #2979
package.jsonscript changesprek.tomlchanges (disabling skillmark/actionlint)Test plan
nextpicks up LCOV reports after mergeSupersedes #2977.
Co-authored-by: Sorin Sbarnea ssbarnea@users.noreply.github.com