Skip to content

Add automated duplicate issue detection and auto-close workflows#5276

Open
qianheng-aws wants to merge 7 commits intoopensearch-project:mainfrom
qianheng-aws:dedup-issue
Open

Add automated duplicate issue detection and auto-close workflows#5276
qianheng-aws wants to merge 7 commits intoopensearch-project:mainfrom
qianheng-aws:dedup-issue

Conversation

@qianheng-aws
Copy link
Copy Markdown
Collaborator

@qianheng-aws qianheng-aws commented Mar 27, 2026

Summary

  • Add GitHub Actions workflows using claude-code-action with AWS Bedrock (OIDC) to automatically detect and close duplicate issues
  • claude-dedupe-issues.yml(LLM-invoked): triggers on new issues, uses Claude to search for potential duplicates
  • auto-close-duplicates.yml(NO-LLM): daily cron job closes flagged issues after a 3-day grace period if no objection
  • remove-duplicate-on-activity.yml(NO-LLM): removes duplicate label when a human comments, preventing auto-closure
  • backfill-duplicate-comments.yml(LLM-invoked): run to backfill historical issues for dedup detection, default 90 days and configuration.

How is works

Blew snapshots are based on the test in my personal repo

  1. A new create issue will trigger claude-dedupe-issues.yml
    It will invoke Claude Code and use /dedup command(see more details in dedupe.md) to detect duplicated issue:
  • Do nothing if no duplicated issues detected
  • Comprehensive comment and duplicate tag will be added otherwise
image
  1. Fight back the dedupe detection results.
  • Anyone leaving any comments on duplicate issues will trigger remove-duplicate-on-activity.yml workflow, and it will remove that tag
image
  • Anyone give thumb-down reaction on that comment will also prevent auto closing.
image
  • Maintainers can choose removing duplicate tag as well.
  1. auto-close-duplicates.yml is a daily cron job closing autoclose issues which is flagged more than 3 days
image

Test plan

  • Created 3 pairs of duplicate issues on fork repo to verify detection
  • Confirmed dedupe workflow triggers on new issue creation
  • Confirmed Claude correctly identifies and comments on duplicate issues
  • Verified duplicate label is applied to detected duplicates
  • Verified leaving comments will trigger removing duplicate label
  • Verified feedback with thumb-down reaction will prevent auto closing
  • Verified the auto close workflow will close the issue with duplicate tag while no thumb-down reaction. Tested by reducing the grace time to 1 hour in my personal repo.
  • Run backfill workflow can successfully trigger dedup detect workflows.

Signed-off-by: Heng Qian qianheng@amazon.com

Implements a 3-workflow system using claude-code-action with Bedrock OIDC:
- claude-dedupe-issues.yml: detects duplicates on new issues via Claude
- auto-close-duplicates.yml: daily cron closes flagged issues after 3 days
- remove-autoclose-on-activity.yml: removes autoclose label on human comment

Signed-off-by: Heng Qian <qianheng@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@qianheng-aws qianheng-aws added the maintenance Improves code quality, but not the product label Mar 27, 2026
- Detected duplicates now get `duplicate` label instead of `autoclose`
- Auto-close workflow looks for `duplicate` label
- After closing, adds `autoclose` label
- Human comment removes `duplicate` label to prevent auto-closure
- Fix state_reason to `duplicate`
- Change grace period to 1 hour for testing

Signed-off-by: Heng Qian <qianheng@amazon.com>
- Add backfill-duplicate-comments.yml to scan historical issues for duplicates
- Add thumbs-down instruction to duplicate detection comment

Signed-off-by: Heng Qian <qianheng@amazon.com>
songkant-aws
songkant-aws previously approved these changes Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

PR Code Analyzer :...

Addressed in commit 9743698

@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Signed-off-by: Heng Qian <qianheng@amazon.com>
- Remove unnecessary allowed_non_write_users from dedupe workflow
- Pass workflow inputs via env vars to prevent JS injection in backfill
- Use bash array for REPO_FLAG to prevent word splitting in shell script

Signed-off-by: Heng Qian <qianheng@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Backfill workflow dispatches dedupe via API as github-actions[bot],
which requires explicit allowlisting in claude-code-action.

Signed-off-by: Heng Qian <qianheng@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

…kflow

Signed-off-by: Heng Qian <qianheng@amazon.com>
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improves code quality, but not the product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants