Skip to content

chore(ci): refine SonarCloud coverage and branch config - #2977

Draft
ssbarnea wants to merge 1 commit into
nextfrom
chore/sonar-config
Draft

chore(ci): refine SonarCloud coverage and branch config#2977
ssbarnea wants to merge 1 commit into
nextfrom
chore/sonar-config

Conversation

@ssbarnea

Copy link
Copy Markdown
Member

Summary

  • Improve SonarCloud configuration for the next branch: coverage paths, test scope, branch-analysis documentation, and quieter admin log levels.

Changes

  • Add sonar.javascript.lcov.reportPaths=**/coverage/**/lcov.info so JS/TS coverage is picked up from Vitest and WDIO outputs
  • Include packages/common/test/ in sonar.tests
  • Document long-lived branch pattern for SonarCloud (next, branch-*, release-*) without hardcoding sonar.branch.name / sonar.branch.target
  • Align log settings (sonar.debug=false, sonar.log.level.app=INFO, sonar.verbose=false)
  • Ignore **/*.tgz in .gitignore

Quality of life

  • None (config-only change)

Test plan

  • npm run compile && npm run lint && npm run lint:knip && npm run test:coverage && npm run build passes locally
  • SonarCloud scan on next picks up lcov reports after merge

Made with Cursor

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>
Copilot AI review requested due to automatic review settings June 30, 2026 17:19
@ssbarnea ssbarnea added the chore label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 9fe0ae0d-f5d1-4d0d-96af-b18cffe61201

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sonar-config

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.properties and reduce scanner logging verbosity.
  • Expand SonarCloud test scope to include packages/common/test/ and add an LCOV report path configuration.
  • Ignore *.tgz artifacts 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.

Comment thread sonar-project.properties
# 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

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cidrblock

Copy link
Copy Markdown
Contributor

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:

  • Explicit LCOV report paths (comma-separated, per Copilot's review about unreliable glob expansion)
  • packages/common/test/ added to sonar.tests
  • Branch-analysis documentation
  • Log verbosity reduction

What's added from #2979:

  • Coverage artifact upload via ansible/actions/upload-artifact (SHA-pinned to v1.1.2)
  • **/*.tgz in .gitignore

You're credited as co-author on the commit. If #2985 looks good, this one can be closed. Thanks for the original work!

cidrblock added a commit that referenced this pull request Jun 30, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants