test: [DO NOT MERGE] validate patch-coverage gate fails below 80%#19175
Closed
yihua wants to merge 5 commits into
Closed
test: [DO NOT MERGE] validate patch-coverage gate fails below 80%#19175yihua wants to merge 5 commits into
yihua wants to merge 5 commits into
Conversation
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.
3 tasks
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-utilitieshelper with no test, so the changed lines report 0% patch coverage. ThePatch Coveragecheck from #19173 (included on this branch) is expected to FAIL (below the 80% threshold).Summary and Changelog
PatchCoverageProbe(hudi-utilities) with no accompanying test.patch_coverage.ymlworkflow from chore: gate pull requests on 80% patch coverage #19173 so the gate runs on this PR.Impact
None (validation only; not for merge).
Risk Level
none
Documentation Update
none
Contributor's checklist