feat(action): add incremental_scope input to dedupe against any PR comment - #1128
Open
DavidEsteso wants to merge 2 commits into
Open
feat(action): add incremental_scope input to dedupe against any PR comment#1128DavidEsteso wants to merge 2 commits into
DavidEsteso wants to merge 2 commits into
Conversation
…mment incremental mode only skips inline comments that overlap the bot's own history, so a line a human reviewer already commented on gets a second, overlapping comment from the action. incremental_scope selects the history: 'bot' (default, current behavior) or 'all' (every review comment on the PR). Unknown values behave as 'bot'.
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s). |
Match the buildPolicy convention for enum inputs (String(x).trim().toLowerCase()) and drop the redundant 'bot' fallback in the wiring; an empty value already behaves as 'bot'.
DavidEsteso
marked this pull request as ready for review
September 2, 2026 07:26
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.
Description
incremental: 'true'deduplicates only against comments the action itself posted. When a human reviewer has already commented on a line, the action still adds its own overlapping comment there, so the author reads the same feedback twice.This adds an
incremental_scopeinput that selects the history the overlap test runs against:'bot'(default): only comments posted by this action's token. Current behavior, unchanged.'all': every review comment on the PR, regardless of author. A line a human reviewer already covered is skipped.Any other value behaves as
'bot'. The input is ignored unlessincrementalis'true'. When scope is'all', thegetAuthenticatedcall is skipped since the author filter is not needed.One caveat, documented in the examples README: the overlap test is positional, not semantic, so under
'all'a human comment about something unrelated on the same lines also suppresses the action's comment. That trade-off is why'bot'stays the default.Type of Change
How Has This Been Tested?
make testpasses locally (node scripts/github-actions/post-review-comments.test.jsandnode scripts/github-actions/action-contract.test.js, both green)Added
testIncrementalScopeAllDedupesAgainstHumanComments: with a human-authored comment in history, the default scope posts the overlapping comment (skipped=0) andincrementalScope: "all"suppresses it (skipped=1).Checklist
go fmt,go vet)Related Issues
None.
🤖 Generated with Claude Code