chore(ci): refine SonarCloud coverage and branch config - #2977
Conversation
Add lcov report path, include packages/common tests, document long-lived branch pattern for next, and align log levels. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedDraft detected. 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)
Comment |
There was a problem hiding this comment.
Pull request overview
Refines the repository’s SonarCloud project configuration to improve branch-analysis guidance, coverage import, and logging verbosity, plus a small ignore-rule addition for packaged artifacts.
Changes:
- Document SonarCloud long-lived branch pattern guidance in
sonar-project.propertiesand reduce scanner logging verbosity. - Expand SonarCloud test scope to include
packages/common/test/and add an LCOV report path configuration. - Ignore
*.tgzartifacts in Git.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sonar-project.properties | Updates SonarCloud branch-analysis guidance, log verbosity, test paths, and LCOV coverage configuration. |
| .gitignore | Adds an ignore rule for .tgz artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # set the pattern (Project > Branches) to: ^(next|(branch|release)-.*)$ | ||
| sonar.debug=false | ||
| sonar.log.level.app=INFO | ||
| sonar.javascript.lcov.reportPaths=**/coverage/**/lcov.info |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
|
Hey @ssbarnea — I combined the SonarCloud-relevant pieces from this PR and #2979 into a single focused PR: #2985. What's included from this PR:
What's added from #2979:
You're credited as co-author on the commit. If #2985 looks good, this one can be closed. Thanks for the original work! |
## 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) - **LCOV report paths**: configure explicit comma-separated paths (`coverage/lcov.info,coverage/wdio/lcov.info`) instead of glob patterns — SonarScanner's wildcard handling for this property is inconsistent ([Copilot review on #2977](#2977 (review))) - **Test scope**: add `packages/common/test/` to `sonar.tests` (was missing) - **Branch-analysis docs**: document long-lived branch pattern for SonarCloud without hardcoding `sonar.branch.name`/`sonar.branch.target`, which would break PR scans - **Log verbosity**: reduce from `DEBUG`/`verbose=true` to `INFO`/`false` — `DEBUG` is only useful when diagnosing scanner issues - **Coverage artifact upload**: upload LCOV files from `build-and-test` and `ui` jobs via `ansible/actions/upload-artifact@b2b0657c # v1.1.2` (gitleaks-secured wrapper around `actions/upload-artifact`) - **`.gitignore`**: ignore `**/*.tgz` packaging artifacts ### Codecov 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: true` was merging stale (pre-#2983) inflated coverage data for flags that hadn't yet uploaded fresh results. - **Disable carry-forward** for all 5 flags (`unit-node22/24/26`, `wdio`, `wsl-fedora`) — each flag uploads fresh data on every CI run, so carry-forward is unnecessary and was actively harmful - **Increase `after_n_builds`** from 3 to 5 to match actual upload count (3 build-and-test matrix + 1 wdio + 1 wsl) - **Enable `wait_for_ci`** so Codecov waits for all uploads before computing the final merged report ## What was NOT included from #2979 - Job consolidation (we intentionally have separate lint/test/integration/ui/package jobs) - WSL workflow deletion (we recently added WSL CI with retry logic in #2981) - `package.json` script changes - `prek.toml` changes (disabling skillmark/actionlint) ## Test plan - [ ] CI passes (no source code changes — config only) - [ ] Codecov reports honest coverage (~39%) after all 5 uploads complete - [ ] SonarCloud scan on `next` picks up LCOV reports after merge - [ ] Coverage artifacts appear in Actions run summary Supersedes #2977. Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com> --------- Co-authored-by: Sorin Sbarnea <ssbarnea@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
nextbranch: coverage paths, test scope, branch-analysis documentation, and quieter admin log levels.Changes
sonar.javascript.lcov.reportPaths=**/coverage/**/lcov.infoso JS/TS coverage is picked up from Vitest and WDIO outputspackages/common/test/insonar.testsnext,branch-*,release-*) without hardcodingsonar.branch.name/sonar.branch.targetsonar.debug=false,sonar.log.level.app=INFO,sonar.verbose=false)**/*.tgzin.gitignoreQuality of life
Test plan
npm run compile && npm run lint && npm run lint:knip && npm run test:coverage && npm run buildpasses locallynextpicks up lcov reports after mergeMade with Cursor