Repository navigation
fix: keep the PR comment under GitHub's size limit - #338
Conversation
A pull request with a few dozen failing commits made a report longer than the 65,536 characters GitHub accepts in a comment. The API refused it, and an earlier comment, perhaps one that said passed, stayed up. A report that does not fit now leaves out the listing of all checks, then everything under the group lines, and links to the run for the rest. The job summary keeps the full report.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Pre-merge checks:
|
|
On a runner GITHUB_REPOSITORY and GITHUB_RUN_ID are set, so the report measured outside the patched environment linked a longer run URL than the comment did, and the limit taken from it let the comment keep its diff.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #338 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 1003 1029 +26
=========================================
+ Hits 1003 1029 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GitHub accepts at most 65,536 characters in a comment. The report quotes every failing commit's message in the diff, the agent prompt and the "All N checks" listing, so a pull request with a few dozen failing commits went past it: about 75 failing commits with a three-line body, about 20 with an eight-line one (measured with CLI 2.20.5). The API then refused the comment, the step log showed a warning, and a comment from an earlier run, possibly one that said "passed", stayed on the pull request.
The PR comment now shortens itself when it would not fit:
The job summary is unchanged and keeps the full report. Length is counted the way GitHub counts it, in UTF-16 code units, so emoji in commit messages cannot tip it over.
Before and after
Tests
main.pycoverage stays at 100% (lines and branches).