Skip to content

feat(ci): wire Build stacks to Codecov tokenless#4646

Merged
Yicong-Huang merged 1 commit into
apache:mainfrom
Yicong-Huang:feat/codecov-phase1
May 2, 2026
Merged

feat(ci): wire Build stacks to Codecov tokenless#4646
Yicong-Huang merged 1 commit into
apache:mainfrom
Yicong-Huang:feat/codecov-phase1

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 2, 2026

What changes were proposed in this PR?

Wire each Build stack up to Codecov so every PR and main push shows a coverage report. Phase 1: tokenless upload only — no PR comments, no status check, no quality gates yet.

Per-stack changes in build.yml:

stack test command change report uploaded
frontend yarn test:ci --code-coverage ./frontend/coverage/**/lcov.info (ubuntu only)
scala sbt jacoco (was sbt test) ./**/target/scala-2.13/jacoco/report/jacoco.xml
python pytest --cov=. --cov-report=xml -sv ./amber/src/main/python/coverage.xml (3.12 only)
agent-service bun test --coverage --coverage-reporter=lcov ./agent-service/coverage/lcov.info (ubuntu only)

project/plugins.sbt: add sbt-jacoco 3.5.0. JaCoCo works on JVM bytecode and is Scala-version-agnostic; the more idiomatic sbt-scoverage does not publish a scalac-scoverage-plugin for Scala 2.13.18 (the version Texera builds on; scoverage's last published Scala version is 2.13.16).

frontend/package.json: add karma-coverage to dev dependencies. Angular's --code-coverage flag in the Karma builder needs the package available in node_modules; without it Karma fails at startup with "Found 1 load error".

New amber/dev-requirements.txt keeps test-only Python deps (currently pytest-cov) separate from runtime requirements. CI installs it after the LICENSE-binary pip-licenses snapshot, so dev tools never show up in the binding license check or in packaging.

Each upload uses codecov/codecov-action pinned to v5.5.4 (75cd11691c0faa626561e295848008c8a7dddffe) per the ASF GitHub Actions policy on third-party actions, and fail_ci_if_error: false so a transient Codecov outage does not turn the Build red.

Any related issues, documentation, discussions?

Closes #4645. Phase 2 (separate task, deferred) opens an INFRA ticket to add CODECOV_TOKEN, which unlocks PR diff-coverage comments, commit status, and codecov.yml quality-gate enforcement.

Other ASF projects using this pattern: apache/airflow (with self-fork apache/airflow-codecov-action), NIFI-13210, INFRA-21474 (Superset), INFRA-19493.

How was this PR tested?

Will be exercised by this PR's own scala/python/frontend/agent-service matrix on CI. The first run on main after merge will populate the Codecov baseline; subsequent PRs auto-compare and post a diff in the dashboard at https://app.codecov.io/gh/apache/texera (after the org/repo is registered there — Codecov auto-onboards public repos on first upload).

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

@github-actions github-actions Bot added feature ci changes related to CI labels May 2, 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.

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

@Yicong-Huang Yicong-Huang force-pushed the feat/codecov-phase1 branch from aed0c92 to 4a70f75 Compare May 2, 2026 04:29
@github-actions github-actions Bot added the engine label May 2, 2026
@Yicong-Huang Yicong-Huang changed the title feat(ci): wire Build stacks to Codecov (Phase 1, tokenless) feat(ci): wire Build stacks to Codecov tokenless May 2, 2026
@Yicong-Huang Yicong-Huang force-pushed the feat/codecov-phase1 branch from 4a70f75 to e4f6326 Compare May 2, 2026 04:44
@github-actions github-actions Bot added dependencies Pull requests that update a dependency file frontend Changes related to the frontend GUI labels May 2, 2026
Generate per-stack coverage reports and upload them to Codecov from
the Build workflow so every PR shows a coverage diff against main and
main pushes refresh the baseline.

Per-stack changes in build.yml:

- frontend: pass --code-coverage to nx test (yarn test:ci); upload
  ./frontend/coverage/**/lcov.info with flag=frontend (ubuntu-latest
  only, to avoid duplicate uploads from the windows/macos matrix).
- scala: switch backend tests to 'sbt coverage test coverageReport',
  which instruments compile via sbt-scoverage and emits per-module
  scoverage.xml; upload ./**/scoverage-report/scoverage.xml with
  flag=scala. New plugin in project/plugins.sbt: sbt-scoverage 2.0.12.
- python: pytest --cov=. --cov-report=xml; upload coverage.xml with
  flag=python on the 3.12 matrix entry only. pytest-cov is installed
  after the LICENSE-binary pip-licenses snapshot so it does not show
  up in the binding license check.
- agent-service: bun test --coverage --coverage-reporter=lcov; upload
  ./agent-service/coverage/lcov.info with flag=agent-service on the
  ubuntu-latest matrix entry only.

Each upload uses codecov/codecov-action pinned to v5.5.4
(75cd11691c0faa626561e295848008c8a7dddffe) per the ASF GitHub Actions
policy on third-party actions. Tokenless mode for Phase 1 — public
repo + Codecov v5 OIDC fallback handles upload, no CODECOV_TOKEN
needed yet. Phase 2 (separate task) opens an INFRA ticket for the
token to enable PR comments / commit status / quality gates.

Each upload step uses 'fail_ci_if_error: false' so a transient
Codecov outage does not turn the Build red.

Closes apache#4645

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Yicong-Huang Yicong-Huang force-pushed the feat/codecov-phase1 branch from e4f6326 to 457a3a4 Compare May 2, 2026 04:53
@Yicong-Huang Yicong-Huang added the release/v1.1.0-incubating back porting to release/v1.1.0-incubating label May 2, 2026
@Yicong-Huang Yicong-Huang requested a review from aglinxinyuan May 2, 2026 05:04
Copy link
Copy Markdown
Contributor

@aglinxinyuan aglinxinyuan left a comment

Choose a reason for hiding this comment

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

LGTM! Let's ignore the frontend coverage for now. We can add more frontend test cases after replacing Karma.

@Yicong-Huang Yicong-Huang merged commit a0e1d22 into apache:main May 2, 2026
36 of 40 checks passed
github-actions Bot pushed a commit that referenced this pull request May 2, 2026
### What changes were proposed in this PR?

Wire each Build stack up to Codecov so every PR and main push shows a
coverage report. Phase 1: tokenless upload only — no PR comments, no
status check, no quality gates yet.

Per-stack changes in `build.yml`:

| stack | test command change | report uploaded |
|---|---|---|
| frontend | `yarn test:ci --code-coverage` |
`./frontend/coverage/**/lcov.info` (ubuntu only) |
| scala | `sbt jacoco` (was `sbt test`) |
`./**/target/scala-2.13/jacoco/report/jacoco.xml` |
| python | `pytest --cov=. --cov-report=xml -sv` |
`./amber/src/main/python/coverage.xml` (3.12 only) |
| agent-service | `bun test --coverage --coverage-reporter=lcov` |
`./agent-service/coverage/lcov.info` (ubuntu only) |

`project/plugins.sbt`: add `sbt-jacoco` 3.5.0. JaCoCo works on JVM
bytecode and is Scala-version-agnostic; the more idiomatic
`sbt-scoverage` does not publish a `scalac-scoverage-plugin` for Scala
2.13.18 (the version Texera builds on; scoverage's last published Scala
version is 2.13.16).

`frontend/package.json`: add `karma-coverage` to dev dependencies.
Angular's `--code-coverage` flag in the Karma builder needs the package
available in `node_modules`; without it Karma fails at startup with
"Found 1 load error".

New `amber/dev-requirements.txt` keeps test-only Python deps (currently
`pytest-cov`) separate from runtime requirements. CI installs it after
the LICENSE-binary `pip-licenses` snapshot, so dev tools never show up
in the binding license check or in packaging.

Each upload uses `codecov/codecov-action` pinned to v5.5.4
(`75cd11691c0faa626561e295848008c8a7dddffe`) per the [ASF GitHub Actions
policy](https://infra.apache.org/github-actions-policy.html) on
third-party actions, and `fail_ci_if_error: false` so a transient
Codecov outage does not turn the Build red.

### Any related issues, documentation, discussions?

Closes #4645. Phase 2 (separate task, deferred) opens an INFRA ticket to
add `CODECOV_TOKEN`, which unlocks PR diff-coverage comments, commit
status, and `codecov.yml` quality-gate enforcement.

Other ASF projects using this pattern:
[apache/airflow](https://app.codecov.io/gh/apache/airflow/branch/main)
(with self-fork
[`apache/airflow-codecov-action`](https://github.com/apache/airflow-codecov-action)),
[NIFI-13210](https://issues.apache.org/jira/browse/NIFI-13210),
[INFRA-21474
(Superset)](https://issues.apache.org/jira/browse/INFRA-21474),
[INFRA-19493](https://issues.apache.org/jira/browse/INFRA-19493).

### How was this PR tested?

Will be exercised by this PR's own scala/python/frontend/agent-service
matrix on CI. The first run on `main` after merge will populate the
Codecov baseline; subsequent PRs auto-compare and post a diff in the
dashboard at https://app.codecov.io/gh/apache/texera (after the org/repo
is registered there — Codecov auto-onboards public repos on first
upload).

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

(backported from commit a0e1d22)
Yicong-Huang added a commit that referenced this pull request May 2, 2026
### What changes were proposed in this PR?

Follow-up to #4646. The upload steps wired in that PR for the scala and
frontend stacks have been silently uploading nothing (`Found 0 coverage
files to report` in the Codecov action logs); only `python` and
`agent-service` flags reach Codecov today. Reason: the underlying tools
were not configured to write the report files at the paths the upload
globs expected.

`frontend/karma.conf.js`:
- Add `"coverage"` to the explicit `reporters` list. Without this,
Angular's `--code-coverage` flag cannot inject the `karma-coverage`
reporter because the user-supplied `reporters` array overrides Angular's
defaults.
- Add an explicit `coverageReporter` block writing `lcovonly` to
`frontend/coverage/lcov.info` — the path the Codecov upload step globs
(`./frontend/coverage/**/lcov.info`).

`build.sbt`:
- Set `ThisBuild / jacocoReportSettings` to use both `ScalaHTMLReport()`
and `XMLReport(encoding = "utf-8")`. By default `sbt-jacoco` emits only
HTML; without XML there is nothing for Codecov to read at
`<module>/target/scala-2.13/jacoco/report/jacoco.xml`.

### Any related issues, documentation, discussions?

Follow-up to #4646. Original tracking issue: #4645.

### How was this PR tested?

Will be exercised by this PR's own scala and frontend matrices on CI.
Expected post-fix behaviour: both flags appear at
https://app.codecov.io/gh/apache/texera (currently only `python` and
`agent-service` are listed) and per-stack coverage shows up on PR
commits.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7
github-actions Bot pushed a commit that referenced this pull request May 2, 2026
### What changes were proposed in this PR?

Follow-up to #4646. The upload steps wired in that PR for the scala and
frontend stacks have been silently uploading nothing (`Found 0 coverage
files to report` in the Codecov action logs); only `python` and
`agent-service` flags reach Codecov today. Reason: the underlying tools
were not configured to write the report files at the paths the upload
globs expected.

`frontend/karma.conf.js`:
- Add `"coverage"` to the explicit `reporters` list. Without this,
Angular's `--code-coverage` flag cannot inject the `karma-coverage`
reporter because the user-supplied `reporters` array overrides Angular's
defaults.
- Add an explicit `coverageReporter` block writing `lcovonly` to
`frontend/coverage/lcov.info` — the path the Codecov upload step globs
(`./frontend/coverage/**/lcov.info`).

`build.sbt`:
- Set `ThisBuild / jacocoReportSettings` to use both `ScalaHTMLReport()`
and `XMLReport(encoding = "utf-8")`. By default `sbt-jacoco` emits only
HTML; without XML there is nothing for Codecov to read at
`<module>/target/scala-2.13/jacoco/report/jacoco.xml`.

### Any related issues, documentation, discussions?

Follow-up to #4646. Original tracking issue: #4645.

### How was this PR tested?

Will be exercised by this PR's own scala and frontend matrices on CI.
Expected post-fix behaviour: both flags appear at
https://app.codecov.io/gh/apache/texera (currently only `python` and
`agent-service` are listed) and per-stack coverage shows up on PR
commits.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7

(backported from commit 69f3aea)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI dependencies Pull requests that update a dependency file engine feature frontend Changes related to the frontend GUI release/v1.1.0-incubating back porting to release/v1.1.0-incubating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire Build stacks to Codecov (Phase 1: tokenless)

3 participants