2.0 KiB
2.0 KiB
Quality and Monitoring Baseline
CI Quality Gates
Pipeline file: .github/workflows/quality-gates.yml
Stages:
lint-and-test: Ruff + pytest (coverage threshold enforced).security-scan:pip-auditdependency vulnerability scan.
Failure policy:
- Any failed stage blocks merge.
- Coverage floor below threshold blocks merge.
Coverage and Test Scope
Current baseline suites:
- API contracts:
tests/test_api_contracts.py - DB lifecycle workflows:
tests/test_db_workflows.py - Accessibility contracts:
tests/test_accessibility_contract.py - Security/performance smoke checks:
tests/test_security_and_performance.py
UX Validation Checklist
Run manually on desktop + mobile viewport:
- Hero loads with image and CTA visible.
- Feed cards render with source and TL;DR CTA.
- Modal opens/closes with Escape and backdrop click.
- Share controls are visible in light and dark themes.
- Floating back-to-top appears after scrolling and returns to top.
Production Metrics and Alert Thresholds
| Metric | Target | Alert Threshold |
|---|---|---|
API p95 latency (/api/news) |
< 350 ms | > 750 ms for 10 min |
API error rate (5xx) |
< 1% | > 3% for 5 min |
| Scheduler success rate | 100% hourly runs | 2 consecutive failures |
| Feed freshness lag | < 75 min | > 120 min |
Alert Runbook
Incident: Elevated API latency
- Confirm DB file I/O and host CPU saturation.
- Inspect recent release diff for expensive queries.
- Roll back latest deploy if regression is confirmed.
Incident: Scheduler failures
- Check API key and upstream provider status.
- Run
python -m backend.cli force-fetchfor repro. - Review logs for provider fallback exhaustion.
Incident: Error-rate spike
- Check
/api/healthresponse and DB availability. - Identify top failing routes and common status codes.
- Mitigate with rollback or feature flag disablement.
Review/Remediation Log Template
Use this structure for each cycle:
severity=<high|medium|low> owner=<name> area=<frontend|backend|infra> finding=<summary> status=<open|fixed>