fix: use comment.body for noop detection and set per_page: 100#833
Merged
kitsuyui merged 2 commits intoMay 23, 2026
Merged
Conversation
comment.body_text strips HTML comments, so the COMMENT_MARKER (<!-- happy-commit -->) was never present in it. This caused createLuckyCommentAction to always take the update path instead of noop when the comment body was unchanged. Also add per_page: 100 to listComments so the managed comment is not silently missed on PRs with more than 30 comments.
8366a81 to
5dd7344
Compare
🎉 Happy commit!
|
gh-counterPR gate
Repo dashboard
Reported by gh-counter |
Code Metrics Report
Details | | main (8b69839) | #833 (4854cc1) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 99.1% | 99.1% | 0.0% |
| Files | 5 | 5 | 0 |
| Lines | 115 | 115 | 0 |
| Covered | 114 | 114 | 0 |
- | Code to Test Ratio | 1:0.5 | 1:0.5 | -0.1 |
| Code | 1509 | 1511 | +2 |
+ | Test | 833 | 834 | +1 |
+ | Test Execution Time | 2s | 1s | -1s |Code coverage of files in pull request scope (100.0% → 100.0%)
Reported by octocov |
gh-build-size
Reported by gh-build-size |
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.
Summary
Two related issues in
getManagedComment(src/github.ts):Wrong field for noop detection —
getManagedCommentstoredcomment.body_textin the returnedComment.body, butcreateLuckyCommentActioncomparespastComment.bodyagainst thefull Markdown string (which includes the
<!-- happy-commit -->HTML comment marker).
body_textis the plain-text rendering withHTML comments stripped, so this comparison never matched and the
noop branch was unreachable. Fix: use
comment.bodyinstead.Missing per_page on listComments —
octokit.issues.listCommentswas called without
per_page, defaulting to 30 items. On PRs withmore than 30 comments the managed comment could be missed, causing a
duplicate to be created. Fix: add
per_page: 100.Changes
src/github.ts:comment.body_text || ''→comment.body || ''src/github.ts: addper_page: 100tolistCommentssrc/github.spec.ts: updatelistCommentsexpectation to includeper_page: 100Verification
bun run test)bun run lint)bun run build)Trade-offs
per_page: 100covers most real-world PRs. Full pagination (octokit.paginate)would handle the extreme edge case of 100+ comments but adds complexity; it can
be addressed separately if needed.