Repository navigation
Expand backend unit coverage and enforce PR reports - #78
Conversation
PR reader API performanceResult: INCONCLUSIVE 8 inconclusive. Zero request failures across all six runs. Base Three independent runs per revision, each on a fresh GitHub-hosted ARM64 runner. 16 users, 60 seconds/run, 1,000 synthetic articles, cache off, five PgBouncer slots. Latency comparisonAll latency values are in milliseconds; lower is better. Values are medians of three runs.
Additional latency and throughput metricsEach cell shows base → PR. Latencies are in milliseconds.
Individual runs
How to interpret this reportRegressed / Improved: a p95 regression needs >20% and >20 ms increase in the medians and at least two head samples versus the base median. Improvements use the inverse threshold. Within threshold means the change did not meet both thresholds. Inconclusive: a within-revision p95 range >35% of its median and >20 ms is too noisy for a confident latency verdict. Inconclusive latency comparisons are non-blocking: the check passes without claiming an improvement. Confirmed regressions and test/report errors fail the PR gate. Throughput is descriptive: paced users do not measure maximum capacity. This uncached public API test does not establish production health, browser performance or worker capacity. Separate runners can differ in hardware or host load; repetitions and noise checks reduce but cannot eliminate that uncertainty. Full HTML/CSV reports and logs · attempt 1 |
Backend unit coveragePASS · minimum combined coverage 67.60%. Tests: 2971 passed, 0 failed, 0 skipped. Source files: 271.
Unit coverage includes every backend workspace. PostgreSQL/Redis integration tests run separately. Commit: ec5779f · HTML, JSON, XML reports and job logs · attempt 1 |
Code Review ✅ Approved🟡 Medium risk · CI enforces backend coverage and reports results; cache-read metrics are corrected. Expands backend unit coverage from 63.43% to 67.63% combined with 327 new unit cases across nine subsystems, enforces a 67.60% minimum in CI and pre-commit checks, and adds PR reporting with coverage metrics, workspace breakdowns, and HTML/JSON/Cobertura artifacts. No issues found. OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



What changes and why?
Backend unit coverage was not required, and PRs did not expose it. This adds 327 unit cases across authentication, cache consistency, publication policy, reading history, retry selection, relationship coverage, scheduler orchestration, search projections, and decision-worker budgets and leases.
The minimum is 67.60% combined line and branch coverage, enforced in CI and backend pre-commit checks. All 271 Python source files in all 13 backend workspaces are measured, including unimported modules. No coverage exclusions were added. The reports retain module-level line and branch counts, including uncovered paths.
CI uploads HTML, JSON, and Cobertura XML reports and updates one PR comment with test counts, workspace coverage, the minimum, and report links. It rejects missing files, omitted workspaces, inconsistent counters, empty suites, failures, and skips. The comment job has no checkout, validates numeric data, ignores superseded PR heads, and preserves human comments. Report-only reruns reuse the newest applicable unit artifact; failed unit attempts cannot borrow older passing artifacts. Unit attempt metadata supports both flat single-artifact downloads and folders for multiple artifacts. Fork and Dependabot PRs retain job summaries and artifacts because their tokens cannot comment.
Checked
abhi1693/actions: its pinned Python workflow accepts custom test commands, Node setup, and artifact paths, but has no coverage PR commenter. This reuses that workflow, provisions Node 24 for comment-script regression tests, and adds reporting inside the existingci.yml. Release dependencies and the shared Actions pin remain unchanged.A new cache regression test also caught an incorrect metric: a matching-revision entry without a payload was counted as both a hit and a miss. It is now counted only as a miss.
Validation
Updated against master after #77 and reader touch-fixture PR #87. Final hosted CI passes on
ec5779f20cc611d4bfa0d7e2e51716dd629f6570:CI required, the coverage-comment job, all CodeQL analyses and both Sonar checks. Auto-merge remains disabled.[[ ... ]]. No gate, rule or source-exclusion changes were made.Rollout notes
pytest-covandcoverageare development-only dependencies. No schema or API contracts change. Integration tests remain independent requirements and do not inflate unit coverage. The only runtime change corrects catalog-cache read metrics.Whole-backend 100% was not reached. The reports retain the uncovered paths; larger follow-up targets include discovery, recommendations, topic proposals, user profiles, and research-verification workers. PostgreSQL/Redis transaction behavior still requires real integration verification alongside unit tests.
Ready for review
Before merge, keep the current commit passing CI required and standard CodeQL, and resolve review conversations.