Skip to content

test: [DO NOT MERGE] validate patch-coverage gate fails below 80%#19175

Closed
yihua wants to merge 5 commits into
apache:masterfrom
yihua:cov-validate-fail
Closed

test: [DO NOT MERGE] validate patch-coverage gate fails below 80%#19175
yihua wants to merge 5 commits into
apache:masterfrom
yihua:cov-validate-fail

Conversation

@yihua

@yihua yihua commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Describe the issue this Pull Request addresses

Validation PR for #19173 (patch-coverage gate). Not for merge; will be closed after the gate is confirmed.

Exercises the expected-fail path: it adds a small hudi-utilities helper with no test, so the changed lines report 0% patch coverage. The Patch Coverage check from #19173 (included on this branch) is expected to FAIL (below the 80% threshold).

Summary and Changelog

Impact

None (validation only; not for merge).

Risk Level

none

Documentation Update

none

Contributor's checklist

  • Enough context is provided in the sections above

yihua added 4 commits July 3, 2026 16:23
Add a Patch Coverage workflow that runs after Java CI uploads coverage to
Codecov, reads the PR's changed-line (diff) coverage from the Codecov API,
and posts a failing commit status when it is below 80%. This enforces test
coverage on new and modified code without penalizing a PR for the
repository's existing overall coverage. Docs/config/test-only PRs with no
measurable changed source lines pass automatically.
- Poll the Codecov commit endpoint until state=complete and the session
  count stops growing before reading diff coverage, so the gate does not
  score a partially-merged report from the multi-job CI matrix and fail
  PRs spuriously. Fail open if Codecov never settles within the budget.
- Post (and update in place) a patch-coverage report comment on the open
  PR so the result is visible before merging, in addition to the
  coverage/patch commit status.
Switch the trigger from workflow_run to pull_request so the guard runs on
the PR itself (including the PR that introduces it), instead of loading the
definition from the default branch. The job's own pass/fail is the gate and
the result is written to the run summary, so it works for fork PRs where the
token is read-only; the PR comment is posted best-effort on top. Skips
immediately when no main-source (.java/.scala) lines changed, and waits for
Codecov to finish aggregating the CI matrix uploads before scoring.
…fail)

Adds a small hudi-utilities helper with no test, so the changed lines report
0% coverage. Used to validate that the Patch Coverage gate fails below 80%.
Not for merge.
@github-actions github-actions Bot added the size:M PR with lines of changes in (100, 300] label Jul 4, 2026
@hudi-bot

hudi-bot commented Jul 4, 2026

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

@yihua

yihua commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Validation complete: the patch-coverage gate correctly read 0.0% and failed here as intended (see #19173). Closing; recorded as evidence in #19173.

@yihua yihua closed this Jul 4, 2026
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.

2 participants