Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(action): add incremental_scope input to dedupe against any PR comment - #1128

Open
DavidEsteso wants to merge 2 commits into
alibaba:mainfrom
DavidEsteso:feat/incremental-scope
Open

feat(action): add incremental_scope input to dedupe against any PR comment#1128
DavidEsteso wants to merge 2 commits into
alibaba:mainfrom
DavidEsteso:feat/incremental-scope

Conversation

@DavidEsteso

Copy link
Copy Markdown

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_scope input 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 unless incremental is 'true'. When scope is 'all', the getAuthenticated call 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

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally (node scripts/github-actions/post-review-comments.test.js and node scripts/github-actions/action-contract.test.js, both green)
  • Manual testing (describe below)

Added testIncrementalScopeAllDedupesAgainstHumanComments: with a human-authored comment in history, the default scope posts the overlapping comment (skipped=0) and incrementalScope: "all" suppresses it (skipped=1).

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
  • I have signed the CLA

Related Issues

None.

🤖 Generated with Claude Code

…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'.
@CLAassistant

CLAassistant commented Sep 1, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
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
DavidEsteso marked this pull request as ready for review September 2, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants