Skip to content

feat(ci): add coverage regression detection#244

Merged
Mossaka merged 2 commits intomainfrom
copilot/add-coverage-regression-detection
Jan 17, 2026
Merged

feat(ci): add coverage regression detection#244
Mossaka merged 2 commits intomainfrom
copilot/add-coverage-regression-detection

Conversation

Copy link
Contributor

Copilot AI commented Jan 17, 2026

Adds automated detection to prevent test coverage from decreasing on PRs.

Changes

  • New script scripts/ci/compare-coverage.ts

    • Compares coverage-summary.json between PR and base branch
    • Reports overall and per-file coverage deltas
    • Exits non-zero on any regression (lines, statements, functions, or branches)
  • Updated .github/workflows/test-coverage.yml

    • For PRs: runs coverage on both branches, compares, and fails on regression
    • Posts detailed comparison report to PR comment with per-file breakdown
    • For main pushes: unchanged behavior (report only)

Example PR Comment Output

## ✅ Coverage Check Passed

### Overall Coverage

| Metric | Base | PR | Delta |
|--------|------|-----|-------|
| Lines | 77.00% | 78.50% | 📈 +1.50% |
| Statements | 77.33% | 78.80% | 📈 +1.47% |

When regression is detected, the workflow blocks the PR with a clear message indicating which metrics decreased.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Medium Priority] Add coverage regression detection</issue_title>
<issue_description>## Context
From CI/CD Pipeline Gap Assessment (Discussion #227)

Description

Implement automated detection to prevent test coverage from decreasing on PRs. This ensures code quality doesn't regress over time.

Acceptance Criteria

  • Implement coverage threshold checking in CI
  • Block PRs that decrease overall coverage percentage
  • Provide clear feedback on coverage changes in PR comments
  • Configure appropriate coverage thresholds (e.g., maintain 80%+)
  • Consider per-file coverage tracking

Estimated Effort

Approximately 4 hours

Related

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add automated detection for coverage regression in PRs feat(ci): add coverage regression detection Jan 17, 2026
Copilot AI requested a review from Mossaka January 17, 2026 04:34
@Mossaka Mossaka marked this pull request as ready for review January 17, 2026 08:57
@github-actions
Copy link

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 77.19% 77.19% ➡️ +0.00%
Statements 77.27% 77.27% ➡️ +0.00%
Functions 77.17% 77.17% ➡️ +0.00%
Branches 69.76% 69.76% ➡️ +0.00%

Coverage comparison generated by scripts/ci/compare-coverage.ts

@Mossaka Mossaka merged commit 223a935 into main Jan 17, 2026
40 checks passed
@Mossaka Mossaka deleted the copilot/add-coverage-regression-detection branch January 17, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Medium Priority] Add coverage regression detection

2 participants