feat(ci): add coverage check workflow and auto reviewer assignment#6635
Merged
kuny0707 merged 21 commits intotronprotocol:developfrom Apr 8, 2026
Merged
feat(ci): add coverage check workflow and auto reviewer assignment#6635kuny0707 merged 21 commits intotronprotocol:developfrom
kuny0707 merged 21 commits intotronprotocol:developfrom
Conversation
run jacocoTestReport once at root to execute all subprojects upload all module jacoco xml files as a single artifact build madrapps paths dynamically from downloaded xml files
Add pr-reviewer.yml that automatically assigns reviewers based on the PR title scope (conventional commit format). Remove CODEOWNERS as it is now superseded by the workflow-based approach.
Signed-off-by: bladehan1 <bladehan@163.com>
Sunny6889
approved these changes
Apr 6, 2026
halibobo1205
reviewed
Apr 7, 2026
halibobo1205
reviewed
Apr 7, 2026
halibobo1205
reviewed
Apr 8, 2026
Codecov integration is no longer active. Coverage is now handled by JaCoCo + madrapps/jacoco-report in pr-build.yml. - Remove stale codecov badge from README.md - Add DEPRECATED header to codecov.yml for clarity
halibobo1205
approved these changes
Apr 8, 2026
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.
What does this PR do?
Introduces a
base vs PRcoverage comparison gate in PR CI to prevent unnoticed regression of overall coverage.Aggregates multi-module
jacocoTestReport.xmlusingmadrapps/jacoco-report(without using the Gradle aggregation plugin).Adds/adjusts the coverage task pipeline:
coverage-base: generates base coverage usingpull_request.base.shacoverage-pr(reuses Debian11 unit test results): generates PR coveragecoverage-gate: performs gate comparison and outputs resultsGate rules:
changed files coverage > 60%pr_overall - base_overall >= -0.1%Standardizes coverage execution environment to
Debian11 + JDK8 (x86_64), executed in parallel to avoid increasing wall-clock time significantly.Disables automatic PR comments (
update-comment: false) to reduce noise, while retaining logs and step summary outputs.Removes the
macosx86 runner (macos-26-intel) execution item to reduce the impact of occasional failures in this environment on CI stability.Adds auto reviewer assignment workflow (
pr-reviewer.yml) that assigns reviewers based on PR title scope (conventional commit format), replacing CODEOWNERS.Disables Gradle build cache (
--no-build-cache) selectively for coverage jobs to ensure accurate coverage data.Why are these changes required?
Passing a static threshold does not guarantee that the current changes did not introduce regression.
Compared to maintaining historical baseline storage (artifact/JSON state), base-vs-PR comparison under the same conditions is lighter, more practical, and has lower maintenance cost.
Avoids using Gradle aggregation to prevent potential conflicts in multi-module class/exec merging; instead, uses Action-side XML aggregation for better stability.
Auto reviewer assignment ensures consistent, scope-based review coverage without relying on CODEOWNERS.
--no-build-cacheStrategyProblem: GitHub Actions
actions/cachepersists~/.gradle/caches/(includingbuild-cache-1/) across workflow runs. When the Gradle build cache is restored, test tasks are marked asFROM-CACHEand skipped entirely — no tests execute, and no.execfiles are generated. This was observed in run #23942322694 where debian11, rockylinux, and coverage-base completed in ~1 min instead of 20+ min.Root cause: Gradle build cache keys are computed from task inputs (source code, JDK version, JVM args, dependencies). When inputs are identical across runs, cached test outputs (including
.execfiles) are reused. While the cached data is technically valid for identical inputs, it means tests are not actually executed and coverage data comes from a previous run.Solution — selective
--no-build-cache:--no-build-cache.execfiles for PR coverage.execfiles for base coverageCache isolation:
coverage-baseuses an independent cache key prefix (coverage-base-x86_64-gradle-) to prevent cross-contamination withdebian11's dependency cache.Note:
--no-build-cacheonly disables Gradle's task output cache. Dependency download cache (modules-2/) and Gradle wrapper cache remain active, so dependency resolution is still fast.Testing
< 60%> 60%< -0.1%>= -0.1%Changed/PR/Base/Deltaand is readable--no-build-cachefix: confirmed test tasks execute fully (notFROM-CACHE) and.execfiles are freshly generatedNote:
-0.1means-0.1%(not-1%)Auto Reviewer Behavior
Reviewer assignment follows a "first-assign-only" policy — the workflow only assigns reviewers when no reviewers are currently requested on the PR. Once reviewers are assigned (either automatically or manually), subsequent title edits or reopens will not trigger reassignment. This design preserves manually added reviewers and avoids unintended accumulation from title scope changes.
Follow Up
Future optimization: refine trigger conditions from
paths-ignoreto whitelist-based (paths/paths-filter) to reduce unnecessary runs.Extra Details
.github/workflows/pr-build.yml,.github/workflows/pr-reviewer.yml