Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
frontmatter: | description: Ingest or inspect test-coverage reports (LCOV, Cobertura, Clover, Go cover profiles, JaCoCo, Salesforce Apex JSON, or repowise JSON; a coverage.py .coverage builds the per-test map only), or gate a change on its patch coverage in CI. allowed-tools: Bash(repowise coverage:*), Read
Repowise Coverage
Ingest coverage so untested-hotspot markers light up in repowise health and
so repowise impacted-tests can map a diff to the tests that exercise it.
No LLM — pure report ingestion into the local index.
Steps
- If
.repowise/doesn't exist: "This repo isn't indexed yet. Run{{cmd:init}}first." Stop. - Decide the mode from
$ARGUMENTS(see below), run the command, and present a short summary (files covered, line/branch %, whether a per-test map was built). Don't dump raw JSON unless asked.
Modes
Default / "status" — show what is already ingested:
repowise coverage status
Handle $ARGUMENTS:
- "status" / "show" →
repowise coverage status - A report path (
coverage.lcov,lcov.info,coverage.xml,coverage.out,jacoco.xml,test-result-codecoverage.json,.coverage, …) →repowise coverage add <path> - "add" with no path →
repowise coverage add(auto-discover common report paths) - Multiple paths →
repowise coverage add <a> <b>(merged; hit wins) - "check" / "gate" / "patch coverage" →
repowise coverage check [REVSPEC]
Useful flags on add: --verbose for ingestion debug logs; --path <dir>
to point at a different repo; --format <parser> to force a parser instead
of auto-detecting from content.
Gating a change in CI
repowise coverage check reports patch coverage: the share of a change's
executable lines the tests ran. It needs no index, so it runs in CI.
REVSPEC is the change (origin/main...HEAD, base..head, or one commit;
defaults to the default branch ...HEAD).
repowise coverage check origin/main...HEAD --report coverage/lcov.info --fail-under 80
--report FILE(repeatable; discovered from the usual locations when omitted)--fail-under PCTexits 1 below the threshold (defaults tocoverage.fail_underin.repowise/config.yaml)--report-format <parser>forces a parser--format githubwrites annotations plus a step summary in GitHub Actions;--format json|markdownfor other consumers
Notes
coverage addalways stores per-file line/branch coverage.- The per-test map (needed by
{{cmd:impacted-tests}}) is built only when the report carries per-test contexts — e.g. a coverage.py.coveragerecorded withpytest --cov=<package> --cov-context=test(needs pytest-cov), a per-test lcov, or a Salesforcetest-result-<run id>.jsonfromsf apex run test --code-coverage --output-dir <dir>. Reports without contexts ingest aggregates only; say so plainly. - After ingesting, suggest
repowise health --recomputeso untested-hotspot markers update.