feat: sticky-comment-and-job-summary#6
Merged
Conversation
Add two reporting features that share the report markdown: - Sticky PR comment: github_pr.go now lists the PR's comments and PATCHes the one carrying a hidden marker instead of POSTing a new comment on every push. Adds Unmarshal to the json client. - Job summary: a StepSummary reporter writes the report to $GITHUB_STEP_SUMMARY when set, so coverage shows on the Actions run page even on fork PRs that can't be commented on. Wired into the workflow by mounting and passing the summary file. Extracts the shared buildMarkdownReport used by both the comment and the summary, and updates README/AGENTS docs and tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🛡️ Patch Coverage Report
Diff coverage:
Lines = the source lines you changed. Instructions = the executable units the coverage tool counts inside those lines — one line can hold several (e.g. JaCoCo bytecode), so the two counts differ. Coverage by file
7 changed file(s) with no measurable lines (config, docs, generated, or test-only) omitted. 🔍 Uncovered lines (20)🤖 Generated by pull-request-code-coverage — coverage for changed lines only. |
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.
Two reporting features that build on the existing reporter seam and share the report Markdown.
Sticky PR comment
Previously the plugin POSTed a new comment on every push, stacking duplicates on active PRs. Now
github_pr.gofirst GETs the PR's comments and, if it finds the one carrying a hidden marker (<!-- pull-request-code-coverage:patch-coverage -->), PATCHes that comment in place; otherwise it POSTs a new one. A single, always-current coverage comment.Job summary ($GITHUB_STEP_SUMMARY)
New
StepSummaryreporter writes the same Markdown to$GITHUB_STEP_SUMMARYwhen set, so coverage renders on the Actions run page — visible even on fork PRs where the read-only token can't post a comment (pairs with the earlier fork-PR change). The workflow now mounts and passes the summary file.Refactor
Extracted the shared
buildMarkdownReportused by both the PR comment and the job summary, and addedUnmarshalto the JSON client (to read the comments list).Tests / docs
step_summary_test.go; reworkedgithub_pr_test.gofor the GET→PATCH/POST flow (incl. a sticky-update case); mock GitHub API and golden bodies updated for the new GET call and marker.go test ./...,gofmt, andgolangci-lint runall clean.🤖 Generated with Claude Code