This is an automated email from the ASF dual-hosted git repository.
Yicong-Huang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to refs/heads/main by this push:
new a0e1d22dd9 feat(ci): wire Build stacks to Codecov tokenless (#4646)
a0e1d22dd9 is described below
commit a0e1d22dd954749917eaac7b843cfe038237199c
Author: Yicong Huang <[email protected]>
AuthorDate: Fri May 1 22:29:26 2026 -0700
feat(ci): wire Build stacks to Codecov tokenless (#4646)
### 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) <[email protected]>
---
.github/workflows/build.yml | 44 ++++++++++++++--
amber/dev-requirements.txt | 25 +++++++++
frontend/karma.conf.js | 1 +
frontend/package.json | 2 +
frontend/yarn.lock | 125 ++++++++++++++++++++++++++++++++++++++++++--
project/plugins.sbt | 5 ++
6 files changed, 193 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 0635d52cb2..81bcffab63 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -111,7 +111,14 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: ./bin/licensing/check_binary_deps.py npm
frontend/dist/3rdpartylicenses.json
- name: Run frontend unit tests
- run: yarn --cwd frontend run test:ci
+ run: yarn --cwd frontend run test:ci --code-coverage
+ - name: Upload frontend coverage to Codecov
+ if: matrix.os == 'ubuntu-latest' && always()
+ uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe
# v5.5.4
+ with:
+ files: ./frontend/coverage/**/lcov.info
+ flags: frontend
+ fail_ci_if_error: false
scala:
if: ${{ inputs.run_scala }}
@@ -233,7 +240,16 @@ jobs:
echo "api.version=1.52" >> ~/.docker-java.properties
cat ~/.docker-java.properties
- name: Run backend tests
- run: sbt test
+ # 'jacoco' runs tests under sbt-jacoco's JVM agent and emits per-
+ # module jacoco.xml that the codecov upload step picks up.
+ run: sbt jacoco
+ - name: Upload scala coverage to Codecov
+ if: always()
+ uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe
# v5.5.4
+ with:
+ files: ./**/target/scala-2.13/jacoco/report/jacoco.xml
+ flags: scala
+ fail_ci_if_error: false
python:
if: ${{ inputs.run_python }}
@@ -287,9 +303,22 @@ jobs:
- name: Lint with Ruff
run: |
cd amber/src/main/python && ruff check . && ruff format --check .
+ - name: Install dev dependencies
+ # Test-only deps live in amber/dev-requirements.txt and are
+ # installed after the LICENSE-binary snapshot above so they never
+ # appear in pip-licenses output. Packaging skips this file.
+ run: |
+ if [ -f amber/dev-requirements.txt ]; then pip install -r
amber/dev-requirements.txt; fi
- name: Test with pytest
run: |
- cd amber/src/main/python && pytest -sv
+ cd amber/src/main/python && pytest --cov=. --cov-report=xml -sv
+ - name: Upload python coverage to Codecov
+ if: matrix.python-version == '3.12' && always()
+ uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe
# v5.5.4
+ with:
+ files: ./amber/src/main/python/coverage.xml
+ flags: python
+ fail_ci_if_error: false
agent-service:
if: ${{ inputs.run_agent_service }}
@@ -334,4 +363,11 @@ jobs:
- name: Typecheck
run: bun run typecheck
- name: Run unit tests
- run: bun test
+ run: bun test --coverage --coverage-reporter=lcov
+ - name: Upload agent-service coverage to Codecov
+ if: matrix.os == 'ubuntu-latest' && always()
+ uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe
# v5.5.4
+ with:
+ files: ./agent-service/coverage/lcov.info
+ flags: agent-service
+ fail_ci_if_error: false
diff --git a/amber/dev-requirements.txt b/amber/dev-requirements.txt
new file mode 100644
index 0000000000..1bbacb78d6
--- /dev/null
+++ b/amber/dev-requirements.txt
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Test- and dev-only Python dependencies. Installed in CI after the
+# LICENSE-binary snapshot is taken, so packages here never appear in
+# pip-licenses output and never need to be tracked in LICENSE-binary
+# / NOTICE-binary. Not installed by packaging.
+
+# Coverage instrumentation for pytest; emits coverage.xml consumed by
+# Codecov's Phase 1 upload.
+pytest-cov==5.0.0
diff --git a/frontend/karma.conf.js b/frontend/karma.conf.js
index d4ddf157a6..c735bb22dc 100644
--- a/frontend/karma.conf.js
+++ b/frontend/karma.conf.js
@@ -25,6 +25,7 @@ module.exports = function (config) {
plugins: [
require("karma-jasmine"),
require("karma-chrome-launcher"),
+ require("karma-coverage"),
require("@angular-devkit/build-angular/plugins/karma")
],
client: {
diff --git a/frontend/package.json b/frontend/package.json
index dee0563540..c9330e88d9 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -110,6 +110,7 @@
"@types/graphlib": "2.1.8",
"@types/jasmine": "4.6.4",
"@types/json-schema": "7.0.9",
+ "@types/karma-coverage": "^2",
"@types/lodash": "4.14.179",
"@types/lodash-es": "4.17.4",
"@types/node": "20.19.39",
@@ -130,6 +131,7 @@
"jasmine-core": "5.4.0",
"karma": "6.4.4",
"karma-chrome-launcher": "3.2.0",
+ "karma-coverage": "^2.2.1",
"karma-jasmine": "5.1.0",
"nodecat": "2.0.0",
"nx": "22.7.0",
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index 24a2911a8b..74a3634a13 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -844,7 +844,7 @@ __metadata:
languageName: node
linkType: hard
-"@babel/core@npm:7.29.0, @babel/core@npm:^7.23.2, @babel/core@npm:^7.23.9":
+"@babel/core@npm:7.29.0, @babel/core@npm:^7.12.3, @babel/core@npm:^7.23.2,
@babel/core@npm:^7.23.9":
version: 7.29.0
resolution: "@babel/core@npm:7.29.0"
dependencies:
@@ -1101,6 +1101,17 @@ __metadata:
languageName: node
linkType: hard
+"@babel/parser@npm:^7.14.7":
+ version: 7.29.3
+ resolution: "@babel/parser@npm:7.29.3"
+ dependencies:
+ "@babel/types": "npm:^7.29.0"
+ bin:
+ parser: ./bin/babel-parser.js
+ checksum:
10c0/f06920c819550c0db689e4c5b626bf55ba3cebf80ebe9ccfa434e134036cf3de50951fe759f74abb2dae381989239860bde46d4600328578ad1f7114c3711a6d
+ languageName: node
+ linkType: hard
+
"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:^7.28.5":
version: 7.28.5
resolution:
"@babel/plugin-bugfix-firefox-class-in-computed-class-key@npm:7.28.5"
@@ -3178,7 +3189,7 @@ __metadata:
languageName: node
linkType: hard
-"@istanbuljs/schema@npm:^0.1.3":
+"@istanbuljs/schema@npm:^0.1.2, @istanbuljs/schema@npm:^0.1.3":
version: 0.1.6
resolution: "@istanbuljs/schema@npm:0.1.6"
checksum:
10c0/bb0d370bf3dd454d2f37f1bccb8921e2da99adacef2da56ef47850e25d7a4de69cf639ead8c189755aef38921369024b4afea3535a5c2ac9082b3e1171bcbc3a
@@ -6030,6 +6041,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/istanbul@npm:*":
+ version: 0.4.34
+ resolution: "@types/istanbul@npm:0.4.34"
+ checksum:
10c0/d266ee0be9c3c5a81a269191b5257a7571ee6f231ced49d36da6f99aaba0e9881387a7611ace1629371d0baa0d8f0af0321173c88233068438ef6400817ef37c
+ languageName: node
+ linkType: hard
+
"@types/jasmine@npm:4.6.4":
version: 4.6.4
resolution: "@types/jasmine@npm:4.6.4"
@@ -6058,6 +6076,26 @@ __metadata:
languageName: node
linkType: hard
+"@types/karma-coverage@npm:^2":
+ version: 2.0.3
+ resolution: "@types/karma-coverage@npm:2.0.3"
+ dependencies:
+ "@types/istanbul": "npm:*"
+ "@types/karma": "npm:*"
+ checksum:
10c0/d1191409412deeaff5bc98937a20ffff5ef46122293b828b1d92637d00f89db5a80d108d225b03a20b204dba5e8ad46574932c66ecf02b44e931dd221d35d814
+ languageName: node
+ linkType: hard
+
+"@types/karma@npm:*":
+ version: 6.3.9
+ resolution: "@types/karma@npm:6.3.9"
+ dependencies:
+ "@types/node": "npm:*"
+ log4js: "npm:^6.4.1"
+ checksum:
10c0/5a548c66a0e89e5ce0ef5059ed6ef905b22cb4a86fc689f7c3c59e623713fab01fa523443a1ef634beac5626bb96a13bd6546b4efdbb325b55e7ccf6e57b554f
+ languageName: node
+ linkType: hard
+
"@types/lodash-es@npm:4.17.4":
version: 4.17.4
resolution: "@types/lodash-es@npm:4.17.4"
@@ -8782,7 +8820,7 @@ __metadata:
languageName: node
linkType: hard
-"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.3.1, debug@npm:^4.3.2,
debug@npm:^4.3.4, debug@npm:^4.3.6, debug@npm:^4.4.0, debug@npm:^4.4.3,
debug@npm:~4.4.1":
+"debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1,
debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:^4.3.6, debug@npm:^4.4.0,
debug@npm:^4.4.3, debug@npm:~4.4.1":
version: 4.4.3
resolution: "debug@npm:4.4.3"
dependencies:
@@ -10772,6 +10810,7 @@ __metadata:
"@types/graphlib": "npm:2.1.8"
"@types/jasmine": "npm:4.6.4"
"@types/json-schema": "npm:7.0.9"
+ "@types/karma-coverage": "npm:^2"
"@types/lodash": "npm:4.14.179"
"@types/lodash-es": "npm:4.17.4"
"@types/node": "npm:20.19.39"
@@ -10803,6 +10842,7 @@ __metadata:
jszip: "npm:3.10.1"
karma: "npm:6.4.4"
karma-chrome-launcher: "npm:3.2.0"
+ karma-coverage: "npm:^2.2.1"
karma-jasmine: "npm:5.1.0"
lodash-es: "npm:4.17.21"
marked: "npm:17.0.1"
@@ -10978,6 +11018,13 @@ __metadata:
languageName: node
linkType: hard
+"html-escaper@npm:^2.0.0":
+ version: 2.0.2
+ resolution: "html-escaper@npm:2.0.2"
+ checksum:
10c0/208e8a12de1a6569edbb14544f4567e6ce8ecc30b9394fcaa4e7bb1e60c12a7c9a1ed27e31290817157e8626f3a4f29e76c8747030822eb84a6abb15c255f0a0
+ languageName: node
+ linkType: hard
+
"html2canvas@npm:1.4.1":
version: 1.4.1
resolution: "html2canvas@npm:1.4.1"
@@ -11620,7 +11667,7 @@ __metadata:
languageName: node
linkType: hard
-"istanbul-lib-coverage@npm:^3.2.0":
+"istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0":
version: 3.2.2
resolution: "istanbul-lib-coverage@npm:3.2.2"
checksum:
10c0/6c7ff2106769e5f592ded1fb418f9f73b4411fd5a084387a5410538332b6567cd1763ff6b6cadca9b9eb2c443cce2f7ea7d7f1b8d315f9ce58539793b1e0922b
@@ -11640,6 +11687,51 @@ __metadata:
languageName: node
linkType: hard
+"istanbul-lib-instrument@npm:^5.1.0":
+ version: 5.2.1
+ resolution: "istanbul-lib-instrument@npm:5.2.1"
+ dependencies:
+ "@babel/core": "npm:^7.12.3"
+ "@babel/parser": "npm:^7.14.7"
+ "@istanbuljs/schema": "npm:^0.1.2"
+ istanbul-lib-coverage: "npm:^3.2.0"
+ semver: "npm:^6.3.0"
+ checksum:
10c0/8a1bdf3e377dcc0d33ec32fe2b6ecacdb1e4358fd0eb923d4326bb11c67622c0ceb99600a680f3dad5d29c66fc1991306081e339b4d43d0b8a2ab2e1d910a6ee
+ languageName: node
+ linkType: hard
+
+"istanbul-lib-report@npm:^3.0.0":
+ version: 3.0.1
+ resolution: "istanbul-lib-report@npm:3.0.1"
+ dependencies:
+ istanbul-lib-coverage: "npm:^3.0.0"
+ make-dir: "npm:^4.0.0"
+ supports-color: "npm:^7.1.0"
+ checksum:
10c0/84323afb14392de8b6a5714bd7e9af845cfbd56cfe71ed276cda2f5f1201aea673c7111901227ee33e68e4364e288d73861eb2ed48f6679d1e69a43b6d9b3ba7
+ languageName: node
+ linkType: hard
+
+"istanbul-lib-source-maps@npm:^4.0.1":
+ version: 4.0.1
+ resolution: "istanbul-lib-source-maps@npm:4.0.1"
+ dependencies:
+ debug: "npm:^4.1.1"
+ istanbul-lib-coverage: "npm:^3.0.0"
+ source-map: "npm:^0.6.1"
+ checksum:
10c0/19e4cc405016f2c906dff271a76715b3e881fa9faeb3f09a86cb99b8512b3a5ed19cadfe0b54c17ca0e54c1142c9c6de9330d65506e35873994e06634eebeb66
+ languageName: node
+ linkType: hard
+
+"istanbul-reports@npm:^3.0.5":
+ version: 3.2.0
+ resolution: "istanbul-reports@npm:3.2.0"
+ dependencies:
+ html-escaper: "npm:^2.0.0"
+ istanbul-lib-report: "npm:^3.0.0"
+ checksum:
10c0/d596317cfd9c22e1394f22a8d8ba0303d2074fe2e971887b32d870e4b33f8464b10f8ccbe6847808f7db485f084eba09e6c2ed706b3a978e4b52f07085b8f9bc
+ languageName: node
+ linkType: hard
+
"jackspeak@npm:^3.1.2":
version: 3.4.3
resolution: "jackspeak@npm:3.4.3"
@@ -11922,6 +12014,20 @@ __metadata:
languageName: node
linkType: hard
+"karma-coverage@npm:^2.2.1":
+ version: 2.2.1
+ resolution: "karma-coverage@npm:2.2.1"
+ dependencies:
+ istanbul-lib-coverage: "npm:^3.2.0"
+ istanbul-lib-instrument: "npm:^5.1.0"
+ istanbul-lib-report: "npm:^3.0.0"
+ istanbul-lib-source-maps: "npm:^4.0.1"
+ istanbul-reports: "npm:^3.0.5"
+ minimatch: "npm:^3.0.4"
+ checksum:
10c0/6496bb56b19b60e3f24a64e4da712a640a4f047fa271a40e321fca3e399e808246a38d434a1b77db4cc54d8f71164ebcb6cf310ae75c99ef957b7010b5d90f49
+ languageName: node
+ linkType: hard
+
"karma-jasmine@npm:5.1.0":
version: 5.1.0
resolution: "karma-jasmine@npm:5.1.0"
@@ -12573,6 +12679,15 @@ __metadata:
languageName: node
linkType: hard
+"make-dir@npm:^4.0.0":
+ version: 4.0.0
+ resolution: "make-dir@npm:4.0.0"
+ dependencies:
+ semver: "npm:^7.5.3"
+ checksum:
10c0/69b98a6c0b8e5c4fe9acb61608a9fbcfca1756d910f51e5dbe7a9e5cfb74fca9b8a0c8a0ffdf1294a740826c1ab4871d5bf3f62f72a3049e5eac6541ddffed68
+ languageName: node
+ linkType: hard
+
"make-error@npm:^1.1.1":
version: 1.3.6
resolution: "make-error@npm:1.3.6"
@@ -16014,7 +16129,7 @@ __metadata:
languageName: node
linkType: hard
-"semver@npm:^6.3.1":
+"semver@npm:^6.3.0, semver@npm:^6.3.1":
version: 6.3.1
resolution: "semver@npm:6.3.1"
bin:
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 095f00474e..add0e4bc23 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -17,6 +17,11 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.14.6")
+// Coverage instrumentation; emits jacoco.xml that Codecov consumes.
+// JaCoCo (vs scoverage) works on JVM bytecode, so it does not need a
+// per-Scala-version compiler plugin — scalac-scoverage-plugin only
+// publishes up to 2.13.16, but Texera builds on 2.13.18.
+addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.5.0")
// License reporting for dependency compliance auditing
// See: https://github.com/sbt/sbt-license-report
addSbtPlugin("com.github.sbt" % "sbt-license-report" % "1.7.0")