Skip to content

ci(codecov): enforce 85% patch coverage on PRs - #119

Merged
JLaborda merged 1 commit into
developfrom
cursor/codecov-patch-config-230f
Jul 7, 2026
Merged

ci(codecov): enforce 85% patch coverage on PRs#119
JLaborda merged 1 commit into
developfrom
cursor/codecov-patch-config-230f

Conversation

@JLaborda

@JLaborda JLaborda commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Adds codecov.yml so Codecov enforces coverage on new/changed lines in every PR, not only on total project coverage.

Changes

  • codecov.yml (new)
    • Patch: minimum 85% on diff lines (threshold: 2% slack)
    • Project: target: auto — must not regress vs base branch (threshold: 1%)
    • Ignore: tests/** and frozen SEC spike modules (aligned with pyproject.toml [tool.coverage.run] omit)
    • Comments: only when coverage-relevant files change
  • .github/workflows/pr-ci.yml
    • fail_ci_if_error: true on Codecov upload so a failed upload or check fails CI

How it works

  1. CI runs pytest --cov=smartwealthai --cov-report=xml
  2. codecov-action uploads coverage.xml
  3. Codecov compares patch coverage against the PR diff
  4. If patch < 85%, the codecov/patch status check fails

Follow-up (manual, GitHub settings)

To block merges when patch coverage fails, mark the Codecov patch status check as required under branch protection for main and develop.

Open in Web Open in Cursor 

Add codecov.yml with patch and project status checks aligned to
pyproject.toml omit rules. Fail CI when Codecov upload or checks fail.
@JLaborda
JLaborda changed the base branch from main to develop July 7, 2026 11:20
@JLaborda
JLaborda merged commit b5d9586 into develop Jul 7, 2026
4 checks passed
@JLaborda
JLaborda deleted the cursor/codecov-patch-config-230f branch July 7, 2026 11:21
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.

1 participant