Skip to content

ci: add Codecov coverage reporting#21

Merged
cmeans-claude-dev[bot] merged 1 commit into
mainfrom
feature/codecov-integration
Apr 20, 2026
Merged

ci: add Codecov coverage reporting#21
cmeans-claude-dev[bot] merged 1 commit into
mainfrom
feature/codecov-integration

Conversation

@cmeans-claude-dev
Copy link
Copy Markdown
Contributor

@cmeans-claude-dev cmeans-claude-dev Bot commented Apr 20, 2026

Summary

Mirrors mcp-clipboard's Codecov integration. Requested by @cmeans after the mcp-* alignment planning — `CODECOV_TOKEN` is already configured as a repo secret on this repo.

What changed

`pyproject.toml`

  • `pytest-cov>=7.0` added to `[project.optional-dependencies] dev`
  • `[tool.coverage.run] source = ["yt_dont_recommend"]`
  • `[tool.coverage.report] show_missing = true, skip_empty = true`

`.github/workflows/ci.yml`

  • `Run tests` step renamed to `Run tests with coverage`; invocation changed from `pytest tests/ -v` to `pytest --cov --cov-report=xml`
  • New `Upload coverage to Codecov` step using `codecov/codecov-action@v5`. Gated on `matrix.os == 'ubuntu-latest'` so only one upload fires per CI run (matches mcp-clipboard's gating pattern, which keys off Python version — we don't matrix Python here, so OS is the natural single-axis gate). `fail_ci_if_error: false`, token via `secrets.CODECOV_TOKEN`.

`README.md`

  • `Coverage` badge inserted between the `CI` and `Downloads` badges, matching mcp-clipboard's order.

Verification (local)

  • `.venv/bin/pip install 'pytest-cov>=7.0'` then `pytest --cov --cov-report=xml` → 259/259 pass, `coverage.xml` generated (~105 KB)
  • `coverage.xml` parsed cleanly by a spot check against Codecov's expected schema (it's a standard Cobertura-style XML)
  • Baseline overall coverage ~44%. Breakdown:
    • `browser.py` 7% — Playwright-dependent, not unit-tested
    • `diagnostics.py` 0% — currently untested
    • `cli.py` 47%, `state.py` 63%, `config.py` 60%, `scheduler.py` 70%
    • `unblock.py` 83%, `blocklist.py` 86%, `clickbait.py` 87%
  • Generated `coverage.xml` and `.coverage` cleaned up before commit. They are already ignored by pytest-cov / not checked in elsewhere.

Test plan (QA)

  • `uv sync --extra dev` resolves with `pytest-cov>=7.0` pulled in
  • `uv run pytest --cov --cov-report=xml` passes and writes `coverage.xml`
  • After merge: first CI run on `main` uploads coverage to Codecov (watch the `Upload coverage to Codecov` step); Codecov badge on README starts resolving
  • Coverage badge renders correctly on the PR / main README once data lands at Codecov

Out of scope

  • Improving coverage on `browser.py` / `diagnostics.py` — a separate conversation; they require Playwright-level test infra.
  • `codecov.yml` tuning (coverage thresholds, ignored paths) — mcp-clipboard doesn't have one either; defaults work until we have a reason to tighten them.

🤖 Generated with Claude Code

Mirrors mcp-clipboard's Codecov integration:

- pyproject.toml: pytest-cov>=7.0 in dev extras, [tool.coverage.run]
  scoped to the yt_dont_recommend package, [tool.coverage.report] with
  show_missing + skip_empty.
- .github/workflows/ci.yml: swap `pytest tests/ -v` for
  `pytest --cov --cov-report=xml`; add codecov/codecov-action@v5 upload
  step gated on matrix.os == 'ubuntu-latest' so we only upload once per
  CI run. Token via secrets.CODECOV_TOKEN (already configured on the
  repo). fail_ci_if_error: false so Codecov flakiness doesn't break CI.
- README.md: Coverage badge slotted between CI and Downloads.

Verified locally: 259/259 pass under pytest-cov; coverage.xml generated.
Baseline overall coverage ~44% — heavily dragged by browser.py (7%,
Playwright-dependent) and diagnostics.py (0%). Core business modules
are healthier: blocklist.py 86%, clickbait.py 87%, unblock.py 83%,
scheduler.py 70%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the Awaiting CI Dev complete, waiting for CI to pass before QA label Apr 20, 2026
@codecov-commenter
Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@cmeans-claude-dev cmeans-claude-dev Bot added Dev Active Developer is actively working on this PR; QA should not start and removed Dev Active Developer is actively working on this PR; QA should not start labels Apr 20, 2026
@github-actions github-actions Bot added Ready for QA Dev work complete — QA can begin review and removed Awaiting CI Dev complete, waiting for CI to pass before QA labels Apr 20, 2026
@cmeans cmeans added the QA Active QA is actively reviewing; Dev should not push changes label Apr 20, 2026
@github-actions github-actions Bot removed the Ready for QA Dev work complete — QA can begin review label Apr 20, 2026
Copy link
Copy Markdown
Owner

@cmeans cmeans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[QA] Review — zero findings, Ready for QA Signoff.

What passed

Check Result
uv sync --extra dev (local equivalent: pip install pytest-cov>=7.0) Resolves cleanly
pytest --cov --cov-report=xml 259/259 pass; coverage.xml written (~105 KB, Cobertura schema). Overall line-rate ≈ 0.4368 — matches Dev's claimed ~44% baseline.
ruff check src/ tests/ All checks passed!
pyproject.toml additions pytest-cov>=7.0 added to dev extras; [tool.coverage.run] and [tool.coverage.report] follow the standard coverage.py schema.
ci.yml diff Run tests with coverage step invokes pytest --cov --cov-report=xml; new Upload coverage to Codecov step uses codecov/codecov-action@v5, fail_ci_if_error: false, token via secrets.CODECOV_TOKEN.
mcp-clipboard parity mcp-clipboard gates on matrix.python-version == '3.13'; this PR gates on matrix.os == 'ubuntu-latest' because yt-dont-recommend doesn't matrix Python. Single upload per CI run — same intent via a different single-axis gate.
Coverage badge [![Coverage](https://codecov.io/gh/cmeans/yt-dont-recommend/graph/badge.svg)](https://codecov.io/gh/cmeans/yt-dont-recommend) — standard codecov.io schema; position between CI and Downloads matches mcp-clipboard's order.

Findings

None.

Verdict

Applying Ready for QA Signoff. The two post-merge checkboxes (Codecov upload on main + Coverage badge resolving) require data to land at Codecov and are genuinely unverifiable pre-merge — leaving them for the maintainer.

Heads-up: this PR and #22 both touch pyproject.toml (different sections — dev extras + [tool.coverage.*] here, license + authors + classifiers there). The second to merge will want a rebase. No merge-order labels applied — deferring that call to you.

@cmeans cmeans added the Ready for QA Signoff QA passed — ready for maintainer final review and merge label Apr 20, 2026
@github-actions github-actions Bot removed the QA Active QA is actively reviewing; Dev should not push changes label Apr 20, 2026
@cmeans
Copy link
Copy Markdown
Owner

cmeans commented Apr 20, 2026

Dev action items (post-signoff):

@cmeans-claude-dev cmeans-claude-dev Bot added the QA Approved Manual QA testing completed and passed label Apr 20, 2026
@github-actions github-actions Bot removed the Ready for QA Signoff QA passed — ready for maintainer final review and merge label Apr 20, 2026
@cmeans-claude-dev cmeans-claude-dev Bot merged commit 8212058 into main Apr 20, 2026
28 checks passed
@cmeans-claude-dev cmeans-claude-dev Bot deleted the feature/codecov-integration branch April 20, 2026 15:49
cmeans-claude-dev Bot added a commit that referenced this pull request Apr 20, 2026
docs(changelog): backfill [Unreleased] entries for #18, #20, #21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA Approved Manual QA testing completed and passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants