Skip to content

Add codecov#1889

Open
Dreamsorcerer wants to merge 16 commits intodevfrom
codecov
Open

Add codecov#1889
Dreamsorcerer wants to merge 16 commits intodevfrom
codecov

Conversation

@Dreamsorcerer
Copy link
Copy Markdown
Collaborator

Add codecov, so we can easily see coverage changes in each PR.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR integrates Codecov into the CI pipeline by consolidating the test and coverage steps, adding OIDC-based upload actions for both coverage XML and JUnit test results, and introducing a .codecov.yml config targeting the dev branch. Most previous review findings (missing id-token: write, push-only gating, missing coverage combine, missing --junitxml) have been addressed in this revision.

Confidence Score: 4/5

Safe to merge with one minor remaining gap: the Upload coverage step lacks if: ${{ !cancelled() }}, so a mypy failure silently drops the coverage report.

All previous P1 findings (missing OIDC permission, push-only gating, missing coverage combine, missing junitxml) have been resolved. The one unfixed item from prior review threads keeps the ceiling at 4.

.github/workflows/ci.yml — the Upload coverage step condition.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Consolidated test + coverage into a single step; added Codecov upload steps for coverage and test results; added id-token: write; removed push-only gating — most previous P1s addressed, one remaining (no if: !cancelled() on Upload coverage).
.codecov.yml New Codecov config file setting default branch to dev and suppressing "missing data" errors on PRs with require_head/base: false.
pyproject.toml Added branch = true to coverage run config and replaced show_missing/skip_empty with exclude_also patterns to filter boilerplate from reports.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant Runner as CI Runner
    participant Codecov as Codecov

    GH->>Runner: Trigger (push or pull_request)
    Runner->>Runner: Install dependencies
    Runner->>Runner: coverage run -m pytest --junitxml=junit.xml
    Runner->>Runner: coverage combine
    Runner->>Runner: coverage xml → coverage.xml
    Runner->>Runner: mypy (if: !cancelled)
    Runner->>Codecov: Upload coverage.xml (OIDC, fail_ci_if_error)
    Runner->>Codecov: Upload junit.xml test results (if: !cancelled)
Loading

Reviews (9): Last reviewed commit: "Merge branch 'dev' into codecov" | Re-trigger Greptile

Comment thread .github/workflows/ci.yml Outdated
@Dreamsorcerer Dreamsorcerer marked this pull request as draft April 21, 2026 19:04
@Dreamsorcerer Dreamsorcerer marked this pull request as ready for review April 22, 2026 14:13
Comment thread .coveragerc.toml Outdated
Comment thread .github/workflows/ci.yml Outdated
if: github.event_name == 'push'
run: |
/entrypoint.sh bash -c "source .venv/bin/activate && _DIMOS_COV=1 coverage run -m pytest --durations=0 -m 'not (tool or mujoco)' && coverage combine && coverage html && coverage report"
/entrypoint.sh bash -c "source .venv/bin/activate && _DIMOS_COV=1 coverage run -m pytest --durations=0 -m 'not (tool or mujoco)' && coverage xml"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Missing coverage combine drops subprocess coverage data

conftest.py sets COVERAGE_PROCESS_START when _DIMOS_COV=1, which instructs coverage.py to instrument subprocesses and write their data to separate .coverage.<pid> files. Without coverage combine before coverage xml, those files are ignored — only the main-process .coverage file is included in the XML report. The old CI command explicitly ran coverage combine; removing it silently undercounts coverage. The fix is coverage run -m pytest ... && coverage combine && coverage xml.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Comment thread .github/workflows/ci.yml Outdated
Co-authored-by: Sam Bull <aa6bs0@sambull.org>
Comment thread .coveragerc.toml Outdated
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml
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.

2 participants