4 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 df91b42c4f ci(sonar): import test coverage instead of excluding it
The scan job now runs both suites with coverage before scanning:
pytest --cov (pyproject.toml: scripts/ without its tests, relative
paths, coverage.xml) and `npm run test:coverage` (vite.config.ts: v8,
lcov with projectRoot "..", so paths start web/). sonar-project.properties
names both reports and drops sonar.coverage.exclusions.

requirements-test.txt gains pytest-cov 7.1.0 and coverage 7.16.2 with
every file's hash (uv pip compile --universal --generate-hashes
--python-version 3.15; the existing pins are unchanged). web gains
@vitest/coverage-v8 5.0.5, matching vitest; none of its packages has an
install script. Coverage stays off for a plain `npm test`.

The token check is its own job, so the scan steps no longer each repeat
the condition; the workflow grants nothing at the top and the scan job
contents: read. `npm run build:admin` replaces the bare `svelte-kit
sync`: it syncs too, and writes the admin bundle the Worker's tests load.

Locally: 576 vitest tests at 58.35% of lines, 299 pytest tests at 57.7%.
Against main's new-code lines (SonarCloud's isNew), the reports cover
92 of 114 coverable lines, 80.7%: the 80% gate is borderline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:34:51 +07:00
poli0981andClaude Opus 5.5 bbe4e3e118 ci(sonar): declare coverage unmeasured so the gate does not read 0%
The first full CI analysis of main (db804e27) failed the "Sonar way"
quality gate on one condition: coverage on new code 0.0% < 80%, over 109
new lines. The scan uploads no test report, so every executable line
counted as uncovered; automatic analysis never computed coverage, so the
condition was never evaluated before. Every other condition passed, with
0 open issues and 0 hotspots.

sonar.coverage.exclusions=**/* restores that: no lines to cover, no
coverage condition. Measuring coverage means generating reports in the
workflow and removing this line in the same change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:22:50 +07:00
poli0981andClaude Opus 5.5 98430b7bb6 ci(sonar): give the TypeScript analyser the project's tsconfigs
The first CI scan logged "Failed to parse tsconfig web/tsconfig.json":
it extends .svelte-kit/tsconfig.json, which only `svelte-kit sync`
writes, so web/src was analysed without its compiler options or types.
The job now installs web/ (npm ci --ignore-scripts) and syncs before
scanning; both outputs are gitignored, so neither is analysed itself.

sonar.typescript.tsconfigPaths names all six tsconfigs: auto-detection
found only the two named tsconfig.json, leaving the Worker, shared/ and
the tests on fallback options.

The toolchain plan no longer claims sonar-python knows 3.15: the scan
warns and analyses as 3.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:16:51 +07:00
poli0981andClaude Opus 5.5 b465540faf ci: analyse with SonarCloud in CI instead of automatic analysis
A sonarcloud.yml workflow runs SonarSource/sonarqube-scan-action (pinned to
the v8.3.0 commit) on pull requests and main, with full history for blame.
Commits that touch only what the data jobs write are skipped, and a run
without SONAR_TOKEN (forks, Dependabot) passes without scanning.

.sonarcloud.properties becomes sonar-project.properties, now naming the
organization and project key; its scope settings are unchanged. The
toolchain test, Web CI's paths, CLAUDE.md and docs follow the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 19:12:56 +07:00