Merge pull request #205 from poli0981/ci/sonar-coverage-unmeasured
ci(sonar): declare coverage unmeasured so the quality gate does not read 0%
This commit is contained in:
3 files changed
+16
-2
No files matched your search
+2
-1
@@ -17,7 +17,8 @@ All notable changes to this awesome noob repo will be documented here.
|
||||
- **SonarCloud analyses in CI.** A workflow runs the scan on pull requests and
|
||||
on `main` in place of SonarCloud's automatic analysis, with its settings in
|
||||
`sonar-project.properties` (formerly `.sonarcloud.properties`). Commits that
|
||||
only carry data are not scanned.
|
||||
only carry data are not scanned. Coverage is not measured, and the
|
||||
settings say so, so the quality gate no longer reads that as 0%.
|
||||
- **TypeScript 7, Node 26 and Python 3.15.** The type-check runs on
|
||||
TypeScript 7, the native compiler: `tsc` for the Worker, the tests and the
|
||||
admin's Node code, and `svelte-check --tsgo` for the app. TypeScript 6 stays
|
||||
|
||||
@@ -467,7 +467,11 @@ scraping pipeline (`scripts/`) driven by GitHub Actions.
|
||||
without it the analyser logged "Failed to parse tsconfig" and read `web/src`
|
||||
untyped. A new tsconfig joins that list. The job skips commits that touch only what
|
||||
the data jobs write, and passes without scanning when `SONAR_TOKEN` is not
|
||||
available (forks, Dependabot). Suppressing a rule for a file is done in the
|
||||
available (forks, Dependabot). No coverage report is uploaded, so
|
||||
`sonar.coverage.exclusions=**/*` says so: without it every line counted as
|
||||
uncovered and the default "Sonar way" gate (80% coverage on new code) failed
|
||||
`main` (measured 2026-10-22, 0.0% on 109 new lines). Importing coverage
|
||||
means removing that line in the same change. Suppressing a rule for a file is done in the
|
||||
SonarCloud UI, not in this file or with NOSONAR.
|
||||
|
||||
## Frontend gotchas
|
||||
|
||||
@@ -37,6 +37,15 @@ sonar.test.inclusions=scripts/tests/**,**/*.test.ts,web/src/lib/testing/**,web/w
|
||||
sonar.exclusions=scripts/tests/**,**/*.test.ts,web/src/lib/testing/**,web/worker/testing/**,web/admin/mock/**,data/**,games/**,**/*.jsonl,**/*.sql,web/src/app.html,web/src-tauri/gen/android/app/src/main/res/**,web/src-tauri/gen/android/buildSrc/**,web/src-tauri/icons/**
|
||||
|
||||
sonar.sourceEncoding=UTF-8
|
||||
|
||||
# Coverage is not measured: the scan uploads no test report. Without this the
|
||||
# CI scan counts every executable line as uncovered (0%), and the "Sonar way"
|
||||
# gate's 80% coverage-on-new-code condition fails main and any pull request
|
||||
# with 20 or more new coverable lines - a condition automatic analysis never
|
||||
# evaluated. To measure coverage, generate reports in sonarcloud.yml, name them
|
||||
# in sonar.python.coverage.reportPaths / sonar.javascript.lcov.reportPaths, and
|
||||
# delete this line.
|
||||
sonar.coverage.exclusions=**/*
|
||||
# Every TypeScript project in web/. Left to itself the analyser finds only
|
||||
# files named exactly tsconfig.json, and analyses the Worker, shared/ and the
|
||||
# tests without their own compiler options. web/tsconfig.json extends the one
|
||||
|
||||
Reference in new issue
Block a user