Skip to content

fix(scripts): reject self-referential duplicates - #83993

Open
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/reject-self-duplicate-issue
Open

fix(scripts): reject self-referential duplicates#83993
RerankerGuo wants to merge 1 commit into
anthropics:mainfrom
RerankerGuo:fix/reject-self-duplicate-issue

Conversation

@RerankerGuo

Copy link
Copy Markdown

Summary

Prevent comment-on-duplicates.sh from proposing the triggering issue as a duplicate of itself.

The script previously accepted identical base and duplicate issue numbers, posted a self-referential duplicate comment, and returned success. That comment could then be consumed by the automatic duplicate closer.

Changes

  • Reject a duplicate candidate whose number equals BASE_ISSUE.
  • Fail before making any GitHub API calls.
  • Keep the existing numeric and issue-existence validation unchanged.

Verification

  • Reproduced the original behavior with BASE_ISSUE=123 and duplicate 123: the script posted the comment and exited 0.
  • Re-ran the same fixture after the change: the script reports that issue #123 cannot duplicate itself, exits 1, and makes no gh calls.
  • Verified a normal 123 -> 456 case still validates both issues and posts the expected comment.
  • Ran bash -n scripts/comment-on-duplicates.sh.
  • Ran git diff --check.

Scope

This PR only rejects self-references. It does not change duplicate ranking, comment wording, or automatic-close timing.

Prevent the duplicate-comment workflow from proposing the triggering issue as its own duplicate, which could otherwise feed a self-reference into automatic closure.
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.

1 participant