Skip to content

chore(ci): modernize Codecov config for the coverage initiative - #19138

Merged
voonhous merged 3 commits into
apache:masterfrom
yihua:codecov-infra
Jul 27, 2026
Merged

chore(ci): modernize Codecov config for the coverage initiative#19138
voonhous merged 3 commits into
apache:masterfrom
yihua:codecov-infra

Conversation

@yihua

@yihua yihua commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Describe the issue this Pull Request addresses

.codecov.yml has drifted since the module layout changed. Its ignore list points at pre-2021 paths and files that no longer exist (hudi-hive-sync/, com/uber/hoodie/..., hudi-client/src/main/...), its flags block uses names (hudicli, hudispark, ...) that no longer match what CI uploads, per-PR comments are disabled, and there are no components or carryforward. Meanwhile Codecov already receives coverage on every PR and commit, so the config, not the pipeline, is what needs fixing.

Note on generated code: JaCoCo on the Azure report counts generated Avro/Thrift/Protobuf/ANTLR classes, but those have no source committed to git, so they are already absent from the Codecov report. No JaCoCo/Maven exclusion is needed to keep them out of the Codecov number; only the source-backed, non-production paths below need ignoring.

Summary and Changelog

Modernize .codecov.yml so per-PR coverage is accurate and actionable:

  • ignore: remove stale/nonexistent entries; ignore non-production code that Codecov still counts today: hudi-examples, packaging, the hudi-integ-test harness, the vendored HoodieHadoopFSUtils.scala (owned by Spark upstream), and the incubating hudi-platform-service (metaserver, 0% and unshipped; a comment marks it for removal if taken into scope). The per-class legacy-tool ignores (HoodieJsonPayload, the standalone main() utilities) are kept; MercifulJsonConverter is dropped and now counts, since it moved under common.avro in the reorg and has a dedicated TestMercifulJsonConverter.
  • flag_management: carryforward: true so a flag's coverage is retained when its CI job is skipped by the path filter, instead of dropping to zero on partial runs. Replaces the dead flags block.
  • component_management: per-ownership-area components (hudi-common, hudi-client, hudi-flink, hudi-spark-datasource, hudi-utilities, hudi-cli, hudi-hadoop, hudi-sync, hudi-io, hudi-timeline-service, hudi-cloud, hudi-kafka-connect) so each area has a coverage number on every PR. Modules whose CI jobs do not upload a report (e.g. hudi-trino-plugin) are intentionally absent, documented with a comment.
  • comment: post a per-PR summary (project, components, patch delta); previously comment: false.
  • status: project and patch are informational (report, do not fail the build). They can be flipped to enforcing per component as coverage climbs, without gating unrelated PRs now.
  • Documents the Codecov per-PR flow in scripts/jacoco/README.md.

Validated with curl -X POST --data-binary @.codecov.yml https://codecov.io/validate (Valid).

Impact

CI reporting only; no production code, no build change. Contributors will start seeing a Codecov comment on PRs and per-component coverage. The headline number rises modestly once the integration-test harness and examples stop counting.

Risk Level

low

CI-config only. Coverage statuses are informational, so nothing new can fail a build.

Documentation Update

scripts/jacoco/README.md gains a "Per-PR coverage on Codecov" section.

Contributor's checklist

  • Read through contributor's guide
  • Enough context is provided in the sections above
  • Adequate tests were added if applicable

Refresh .codecov.yml so per-PR coverage is accurate and actionable:

- ignore: drop stale entries pointing at pre-2021 paths and files that no
  longer exist; ignore non-production code that Codecov still counts today
  (hudi-examples, packaging, the hudi-integ-test harness, the vendored
  HoodieHadoopFSUtils, and the incubating hudi-platform-service). Generated
  code (Avro/Thrift/Protobuf/ANTLR) has no source in git and is already
  absent from the report, so it needs no exclusion.
- flag_management: carry a flag's coverage forward when its CI job is skipped
  by the path filter, so a partial run does not report a false drop. Replaces
  the old flags block whose names no longer matched the uploads.
- component_management: report coverage per ownership area so each coverage
  subtask can read its own number on every PR.
- comment: post a per-PR summary (project, components, patch); previously off.
- status: project and patch statuses are informational for now (report, do
  not block); can be flipped to enforcing per component as coverage climbs.

Also document the Codecov per-PR flow in scripts/jacoco/README.md.

@hudi-agent hudi-agent left a comment

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.

⚠️ 🤖 This review was generated by an AI agent and may contain mistakes. Please verify any suggestions before applying.

Thanks for the docs update! This adds a helpful "Per-PR coverage on Codecov" section to scripts/jacoco/README.md covering the flag uploads, .codecov.yml behavior, and a local coverage command. The script reference and local mvn example both check out against the repo; the main concern is that the listed flag names don't match what bot.yml actually uploads. Please have a Hudi committer or PMC member confirm before merging.

Comment thread scripts/jacoco/README.md
via `scripts/jacoco/generate_merged_coverage_report.sh`, and uploads `jacoco-report.xml` to
Codecov under a flag (`spark-java-tests`, `spark-scala-tests`, `utilities`,
`common-and-other-modules`, `spark-client-hadoop-common`, `hadoop-mr-java-client`,
`integration-tests`).

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.

🤖 This flag list doesn't match what .github/workflows/bot.yml actually uploads. The workflow uploads a spark-core-tests flag (bot.yml line 1027) which is missing here, and there is no integration-tests flag uploaded anywhere in bot.yml. The full set uploaded today is: spark-client-hadoop-common, utilities, common-and-other-modules, spark-java-tests, spark-scala-tests, hadoop-mr-java-client, spark-core-tests. Could you update the list to match (drop integration-tests, add spark-core-tests)? Note the same discrepancy exists in the flag_management comment in .codecov.yml (lines 71-73), so it'd be worth fixing both together.

⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Checked against current apache/master .github/workflows/bot.yml: the uploaded flags are spark-client-hadoop-common, utilities, common-and-other-modules, spark-java-tests, spark-scala-tests, hadoop-mr-java-client, and integration-tests (the last at bot.yml line 1432). There is no spark-core-tests flag in bot.yml. The list here matches, so leaving it as-is.

Comment thread scripts/jacoco/README.md Outdated
ownership area (hudi-common, hudi-client, hudi-spark-datasource, hudi-flink, ...); and
`flag_management` carries a flag's coverage forward when its job is skipped by the path filter,
so a partial run does not report a false drop.
- Generated code (Avro, Thrift, Protobuf, ANTLR) has no source committed to git, so it never

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.

🤖 This states generated code "needs no exclusion," but .codecov.yml does keep one generated-code exclusion: hudi-common/src/main/java/org/apache/hudi/avro/model/** (with a comment that it's kept for safety in case sources are ever committed). A reader who cross-references the config may find this slightly contradictory. It might help to note that the one committed-generated Avro path is still ignored defensively, so the statement and the config line up.

⚠️ AI-generated; verify before applying. React 👍/👎 to flag quality.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed: the doc now says generated code (Thrift/Protobuf/ANTLR) needs no exclusion, and notes the one committed generated path (Avro model classes) is still ignored defensively, so the doc and config agree.

- .codecov.yml: restore the individual Java-class ignores from the prior config
  for the classes that still exist (standalone main()-style tools and legacy JSON
  helpers), so their exclusion is unchanged; entries for since-deleted classes and
  stale paths are left dropped.
- scripts/jacoco/README.md: clarify that the committed Avro model path is still
  ignored defensively, so the doc and config agree.
- Base64CodecUtil: temporary no-op comment to trigger CI/Codecov upload (DNM, revert before merge).
@yihua yihua changed the title chore(ci): modernize Codecov config for the coverage initiative [DNM] chore(ci): modernize Codecov config for the coverage initiative Jul 2, 2026
@yihua
yihua marked this pull request as draft July 2, 2026 05:35
@yihua yihua changed the title [DNM] chore(ci): modernize Codecov config for the coverage initiative chore(ci): modernize Codecov config for the coverage initiative [DNM] Jul 2, 2026
@codecov-commenter

codecov-commenter commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.21%. Comparing base (2912bf6) to head (eaec940).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #19138      +/-   ##
============================================
+ Coverage     66.61%   68.21%   +1.60%     
+ Complexity    30378    30180     -198     
============================================
  Files          2683     2543     -140     
  Lines        150666   146072    -4594     
  Branches      18964    18606     -358     
============================================
- Hits         100360    99650     -710     
+ Misses        41811    37979    -3832     
+ Partials       8495     8443      -52     
Components Coverage Δ
hudi-common 79.62% <ø> (+<0.01%) ⬆️
hudi-client 79.44% <ø> (-0.01%) ⬇️
hudi-flink 63.28% <ø> (ø)
hudi-spark-datasource 53.81% <ø> (+0.25%) ⬆️
hudi-utilities 70.48% <ø> (-0.01%) ⬇️
hudi-cli 15.26% <ø> (ø)
hudi-hadoop 64.96% <ø> (ø)
hudi-sync 68.74% <ø> (ø)
hudi-io 79.42% <ø> (ø)
hudi-timeline-service 83.46% <ø> (+0.29%) ⬆️
hudi-cloud 63.85% <ø> (ø)
hudi-kafka-connect 53.20% <ø> (ø)
Flag Coverage Δ
common-and-other-modules 45.11% <ø> (+0.58%) ⬆️
hadoop-mr-java-client 43.84% <ø> (+0.06%) ⬆️
integration-tests 13.98% <ø> (+0.03%) ⬆️
spark-client-hadoop-common 48.07% <ø> (-0.01%) ⬇️
spark-java-tests 47.73% <ø> (+0.08%) ⬆️
spark-scala-tests 44.47% <ø> (+0.21%) ⬆️
utilities 36.69% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...a/org/apache/hudi/common/util/Base64CodecUtil.java 75.00% <ø> (ø)

... and 146 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nsivabalan

Copy link
Copy Markdown
Contributor

Reviewed the config against current apache/master. Overall: low-risk, net-positive, and the config demonstrably works — the Codecov comment on this very PR renders all 12 components, the per-flag table, and carryforward. Approvable once the DNM comment is reverted and one stale path is fixed.

On the disputed flag list: I independently verified against current master .github/workflows/bot.yml — the uploaded flags are exactly the 7 documented: spark-client-hadoop-common, utilities, common-and-other-modules, spark-java-tests, spark-scala-tests, hadoop-mr-java-client, and integration-tests (line 1452). There is no spark-core-tests flag; the earlier bot comment appears to have checked a stale file. @yihua's rebuttal is correct — no change needed.

Component coverage completeness: I mapped every top-level module against component_management + ignore. All second-level subdirs of the multi-module parents (hudi-client, hudi-spark-datasource, hudi-sync, hudi-flink-datasource) are accounted for; hudi-tests-common has no coverable main source (log4j resources only). The one module in neither list is hudi-trino-plugin — see below.

Findings

🚨 Blocking (already acknowledged): revert the temporary DNM comment in Base64CodecUtil.java before merge.

⚠️ Stale ignore path — MercifulJsonConverter: the kept entry hudi-common/src/main/java/org/apache/hudi/avro/MercifulJsonConverter.java no longer resolves; the class moved to org/apache/hudi/common/avro/MercifulJsonConverter.java. This contradicts the PR description's note that only still-resolving entries were kept. Either update the path or drop the entry — and since the class now has dedicated tests (TestMercifulJsonConverter), dropping it and letting it count may be the better call.

💬 hudi-trino-plugin is in neither component_management nor ignore. Currently harmless — its test-hudi-trino-plugin job in bot.yml does not upload to Codecov, so nothing reaches the report. But the config nicely documents intent for hudi-platform-service; suggest doing the same for Trino (a one-line comment, an ignore, or a component) so a reader can tell the omission is deliberate.

💬 notify.wait_for_ci: true vs path-filtered jobs: carryforward covers the coverage number when a job is skipped, but wait_for_ci governs when the PR comment fires. This PR touched hudi-common, which triggers every job, so it doesn't exercise that path. Worth one experiment with a flink-only or docs-only PR to confirm the comment still posts promptly when several flags never upload.

💅 Nits: -Djacoco.skip=false in the README example is redundant (root pom defines no jacoco.skip property; the plugin runs by default under -Punit-tests); README is missing a trailing newline.

Suggested validation before merge

  1. A throwaway PR touching only hudi-flink-datasource (or docs) to confirm skipped flags retain prior coverage via carryforward and the PR comment posts despite wait_for_ci: true.
  2. After fixing the MercifulJsonConverter entry, confirm the file is handled as intended in the next Codecov file list.
  3. After reverting the Base64CodecUtil comment, confirm the final diff shows zero coverable-line changes.

No breaking changes — CI reporting only; the replaced flags: block was already dead.

- Revert the temporary DNM comment in Base64CodecUtil (was only to trigger CI).
- Drop the ignore entry for MercifulJsonConverter: the reorg moved it to
  org.apache.hudi.common.avro and it now has TestMercifulJsonConverter, so let
  it count toward coverage.
- Document that modules whose CI jobs do not upload a JaCoCo report
  (e.g. hudi-trino-plugin) are intentionally absent from ignore/components.
- README nits: drop redundant -Djacoco.skip=false from the local example and
  add the missing trailing newline.
@yihua yihua changed the title chore(ci): modernize Codecov config for the coverage initiative [DNM] chore(ci): modernize Codecov config for the coverage initiative Jul 22, 2026
@yihua

yihua commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough pass. Addressed the blocking and stale items in 2da96e2:

  • 🚨 Reverted the temporary DNM comment in Base64CodecUtil.java, so the diff is now config + docs only with zero coverable-line changes. Also dropped [DNM] from the title.
  • ⚠️ MercifulJsonConverter: dropped the entry (rather than repointing it) so it counts, since the reorg moved it under common.avro and it now has TestMercifulJsonConverter. Updated the neighboring comment and the PR description's "still-resolving" note accordingly.
  • 💬 hudi-trino-plugin: documented the deliberate omission with a comment in the ignore preamble, noting that modules whose CI jobs do not upload a report (its test-hudi-trino-plugin job) never reach Codecov, so they are intentionally absent from both ignore and component_management.
  • 💅 Nits: removed the redundant -Djacoco.skip=false from the README example (confirmed the root pom binds no jacoco.skip and the agent runs by default under -Punit-tests) and added the trailing newline.

On the flag list: thanks for independently confirming against current master; agreed, no change.

On notify.wait_for_ci + path-filtered jobs: good catch that this PR doesn't exercise that path since it touches hudi-common. I'll validate separately with a docs-only or flink-only throwaway PR that the comment still posts promptly when several flags never upload, and flip to wait_for_ci: false if it stalls.

@hudi-bot

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

@nsivabalan
nsivabalan marked this pull request as ready for review July 27, 2026 01:48
@voonhous
voonhous enabled auto-merge (squash) July 27, 2026 06:32
@voonhous voonhous closed this Jul 27, 2026
auto-merge was automatically disabled July 27, 2026 13:24

Pull request was closed

@voonhous voonhous reopened this Jul 27, 2026
@voonhous
voonhous enabled auto-merge (squash) July 27, 2026 14:08
@voonhous
voonhous merged commit 0774d91 into apache:master Jul 27, 2026
152 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M PR with lines of changes in (100, 300]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants