fix(github): skip progress-comment edits whose visible content is unchanged#757
Open
aparajon wants to merge 1 commit into
Open
fix(github): skip progress-comment edits whose visible content is unchanged#757aparajon wants to merge 1 commit into
aparajon wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces unnecessary GitHub API write traffic by avoiding progress-comment edits when the rendered status is unchanged aside from auto-stamped timestamps, while still ensuring periodic “liveness” updates.
Changes:
- Added
templates.CommentContentKeyto normalize rendered comment bodies by collapsing render-time timestamps into a stable comparison key. - Updated
CommentObserverto cache the last written content key per GitHub comment ID and skip PATCH edits when the key is unchanged, with a 10-minute heartbeat to refresh the “Last updated” footer. - Added unit and integration coverage validating both skip behavior and heartbeat refresh behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/webhook/templates/common.go | Adds timestamp-collapsing CommentContentKey used to compare rendered comment “visible content”. |
| pkg/webhook/templates/common_test.go | Unit tests for CommentContentKey stability across re-renders and sensitivity to real progress changes/countdowns. |
| pkg/webhook/comment_observer.go | Adds last-written caching and heartbeat-based skip logic to avoid redundant GitHub comment edits. |
| pkg/webhook/apply_comment_integration_test.go | Integration tests verifying identical renders are skipped and heartbeat refreshes still occur. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…hanged A stagnant apply re-edits its progress comment every 30 seconds forever, even though each render differs only in re-stamped timestamps (the "Last updated" footer and the attribution line). Those PATCHes spend the installation's shared GitHub write budget without showing readers anything new. templates.CommentContentKey collapses rendered timestamps out of a comment body so two renders of an unchanged status compare equal, while real changes (rows, state, checksum) and live durations (revert-window countdown) still differ. The observer remembers the key it last wrote per GitHub comment ID and skips edits whose key is unchanged; a cache miss always edits. Two guards keep unchanged comments from reading as SchemaBot going silent: a comment younger than its 10-minute grace window always edits (young comments are actively watched, and an early stall is exactly when a frozen footer is most alarming — rotation-created comments get a fresh window), and past the grace window skips lapse after a 10-minute heartbeat so a stalled apply's comment still refreshes a few times an hour. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
aparajon
force-pushed
the
armand/progress-comment-dedupe
branch
from
July 19, 2026 00:04
76f5734 to
290a5dd
Compare
aparajon
marked this pull request as ready for review
July 19, 2026 02:00
aparajon
requested review from
Kiran01bm,
eeSeeGee,
jayjanssen and
morgo
as code owners
July 19, 2026 02:00
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.
Why this matters
A stagnant apply re-edits its PR progress comment every 30 seconds forever, even though every render is byte-identical except for two re-stamped timestamps (the "Last updated" footer and the attribution line). Each of those PATCHes spends the installation's shared GitHub write budget — under the secondary content-creation limit, a handful of stalled long-running applies is real pressure — while changing nothing a reader can see.
What it does
templates.CommentContentKey, which collapses rendered timestamps out of a comment body. Two renders of an unchanged status produce equal keys; any real change (rows, state, checksum) produces a different key. Durations such as the revert-window countdown survive in the key, so comments where the passage of time is the information keep editing live.🤖 Generated with Claude Code