Skip to content

Wire Build stacks to Codecov (Phase 1: tokenless) #4645

@Yicong-Huang

Description

@Yicong-Huang

Task Summary

Wire each Build stack (frontend, scala, python, agent-service) up to Codecov so every PR and main push shows a coverage report and a diff against the main baseline. Phase 1 is tokenless: report uploads only, no PR comments / status check / quality gates yet.

Per-stack coverage generation

stack tool command output
scala sbt-scoverage (sbt plugin, native to scala) sbt coverage test coverageReport **/target/scala-2.13/scoverage-report/scoverage.xml
python pytest-cov pytest --cov=. --cov-report=xml -sv coverage.xml (Cobertura format)
frontend Karma + Istanbul (Angular's --code-coverage) nx test --code-coverage frontend/coverage/<project>/lcov.info
agent-service bun test --coverage --coverage-reporter=lcov (built-in) agent-service/coverage/lcov.info

Codecov upload

codecov/codecov-action pinned to a specific SHA per ASF GitHub Actions Policy, one upload step per stack with a distinct flags: so the dashboard shows each language separately:

- uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe  # v5.5.4
  with:
    files: ./**/scoverage-report/scoverage.xml
    flags: scala
    fail_ci_if_error: false

Tokenless upload: CODECOV_TOKEN not required for public Apache repos in v5; rate-limit fallback channel is enough for Phase 1. Phase 2 (separate task) opens an INFRA ticket to add the token, which unlocks PR comments / commit status / quality-gate enforcement.

Where the steps live

The Build workflow (build.yml) already triggers on:

  • push: branches: [main, ci-enable/**, release/**] — uploaded reports become the Codecov baseline
  • pull_request: — Codecov compares against the baseline and renders a diff

So adding the coverage generation + upload steps inside each stack's job covers both flows in one change. Skipped stacks (per LABEL_STACKS from #4640) automatically skip their coverage upload.

Out of scope (deferred to Phase 2)

  • INFRA ticket for CODECOV_TOKEN
  • PR comment / commit status / quality-gate (codecov.yml) configuration
  • Onboarding to SonarCloud (orthogonal alternative)

Priority

P2 – Medium

Task Type

  • Code Implementation
  • DevOps / Deployment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions