ci(coverage): disable jacoco PR comments, relax overall delta threshold to 0.4%#6695
Closed
bladehan1 wants to merge 1 commit intotronprotocol:developfrom
Closed
ci(coverage): disable jacoco PR comments, relax overall delta threshold to 0.4%#6695bladehan1 wants to merge 1 commit intotronprotocol:developfrom
bladehan1 wants to merge 1 commit intotronprotocol:developfrom
Conversation
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
Three targeted fixes to the
coverage-gateCI job inpr-build.yml:comment-type: summaryto bothjacoco-reportsteps — routes output to the workflow step summary instead of PR comments.MAX_DROPfrom-0.1%to-0.4%.Why
Issue 1 — 403 errors on PR comment posting
The
coverage-gatejob declares onlypermissions: contents: read. Themadrapps/jacoco-reportaction defaults tocomment-type: pr_comment, which calls the GitHub PR comment API and requirespull-requests: write. Every CI run was producing a 403 error in the logs, though it did not block the gate because the action's owncontinue-on-errordefault istrue.Setting
comment-type: summarymakes the action write to$GITHUB_STEP_SUMMARY(a local file write, no API call), so the 403 disappears entirely without needing to grant broader token permissions.Issue 2 —
coverage-changed-filesreports INSTRUCTION coverage, not LINE coverageThe value shown as Changed Files Coverage is bytecode instruction coverage, not source-line coverage. This is a fixed behavior of
madrapps/jacoco-report@v1.7.2— the action has nocoverage-typeparameter and internally reads only theINSTRUCTIONcounter from JaCoCo XML.Why INSTRUCTION ≠ LINE and why it matters:
INSTRUCTION,BRANCH,LINE,COMPLEXITY,METHOD,CLASS.if (x != null)may emit 3–5 instructions; a fluent chain on one line may emit 10+.toString, enum boilerplate) inflates the instruction count without adding meaningful semantic coverage.To switch to LINE coverage the action would need to be replaced with a custom script that reads the
LINEcounter (<counter type="LINE" covered="N" missed="M"/>) from each matching<sourcefile>node. The action itself does not expose this as a configuration option in any released version through v1.7.2.Issue 3 —
-0.1%delta threshold causes false failuresNormal variance in test execution timing, minor refactoring (renaming, extracting constants), or adding tests to previously uncovered edge-case paths can shift overall INSTRUCTION coverage by ±0.2%. A threshold of
-0.1%triggered spurious gate failures in these scenarios.-0.4%still catches real coverage regressions while eliminating the noise.