Skip to content

[DevOps/CI] Automated Code Coverage Enforcement & Vitest CI Gate #1333

Description

@blurbeast

Overview & Background

To maintain high code quality across the codebase as open-source contributors submit pull requests, an automated test coverage enforcement gate is required in GitHub Actions CI to prevent coverage regressions.


Technical Specification & Architecture

  1. Vitest Coverage Configuration:
    • Configure @vitest/coverage-v8 in backend/vitest.config.ts and frontend/vitest.config.ts.
    • Set minimum coverage thresholds:
      • Statements: 80%
      • Branches: 75%
      • Functions: 80%
      • Lines: 80%
  2. GitHub Actions Integration:
    • Add coverage generation step in .github/workflows/ci.yml.
    • Post automated coverage summary comment on pull requests.
    • Fail PR build if coverage decreases by $> 1%$.

Target Files

  • backend/vitest.config.ts
  • frontend/vitest.config.ts
  • .github/workflows/ci.yml
  • .github/codecov.yml

Acceptance Criteria

  • Vitest generates lcov coverage reports for backend and frontend.
  • CI workflow fails if code coverage falls below threshold.
  • Automated PR summary table showing coverage changes per modified file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions