Skip to content

Add Duplicate Issue Detector workflow#310

Open
anvayeeem wants to merge 2 commits intoAOSSIE-Org:mainfrom
anvayeeem:add-duplicate-issue-detector
Open

Add Duplicate Issue Detector workflow#310
anvayeeem wants to merge 2 commits intoAOSSIE-Org:mainfrom
anvayeeem:add-duplicate-issue-detector

Conversation

@anvayeeem
Copy link
Copy Markdown

@anvayeeem anvayeeem commented Mar 27, 2026

📝 Description

🔧 Changes Made

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation.
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Chores
    • Added automated duplicate issue detection. The system now analyzes issues when created or edited, comparing them against existing issues to identify potential duplicates. When matches are found, an automated comment is posted and a duplicate label is applied.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

Walkthrough

A new GitHub Actions workflow is added that detects potential duplicate issues when an issue is opened or edited by analyzing content against the past 365 days of issues, posting a comment and applying a duplicate label when similarity exceeds 0.65.

Changes

Cohort / File(s) Summary
Duplicate Issue Detector Workflow
.github/workflows/duplicate_issue_detector.yml
Adds a GitHub Actions workflow triggered on issues: opened and edited. Runs actions-cool/issues-similarity-analysis@v1 with a 365-day lookback and 0.65 similarity threshold, posts a “### 🤖 Potential Duplicate Issues Detected” comment when matches found, and applies the duplicate label. Excludes issues by configured title terms.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub as GitHub Events
    participant Actions as GitHub Actions Runner
    participant Analyzer as issues-similarity-analysis
    participant Repo as Repository Issues

    GitHub->>Actions: issue opened/edited event
    Actions->>Analyzer: run analysis (token, 365d, threshold 0.65, exclude terms)
    Analyzer->>Repo: query recent issues (365 days)
    Analyzer->>Analyzer: compute similarity scores
    alt potential duplicates found
        Analyzer->>Repo: post comment "### 🤖 Potential Duplicate Issues Detected"
        Analyzer->>Repo: apply `duplicate` label
    else no duplicates
        Analyzer->>Repo: no action
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through issues, nose to the screen,
Sniffed out echoes where titles had been,
With a twitch and a nudge, I left a small note,
Labeled the twins and then went to gloat —
Hooray for tidy threads and a well-organized den!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Duplicate Issue Detector workflow' clearly and directly describes the main change: adding a new GitHub Actions workflow for duplicate issue detection.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/duplicate_issue_detector.yml:
- Line 15: The workflow currently references the third-party action as
actions-cool/issues-similarity-analysis@v1 which is mutable; replace that tag
with a pinned immutable commit SHA (full 40-character commit hash) for the
actions-cool/issues-similarity-analysis repository to remove supply-chain
risk—locate the uses: entry referencing
actions-cool/issues-similarity-analysis@v1 in the workflow and update it to
actions-cool/issues-similarity-analysis@<commit-sha> after verifying the desired
commit in the action repo; record or document the chosen SHA so future updates
can be intentional and auditable.
- Line 5: The workflow currently triggers on both "opened" and "edited" (the
line with types: [opened, edited]) causing the
actions-cool/issues-similarity-analysis job to post duplicate comments on issue
edits; fix by removing "edited" from the types array so it only runs on
"opened", or add a concurrency block to the workflow that groups by the issue
identifier (e.g., using github.event.issue.number) with cancel-in-progress: true
to prevent parallel/duplicate runs for the same issue.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e66f9cad-68ab-4a9a-81fa-6838c3042ce8

📥 Commits

Reviewing files that changed from the base of the PR and between a61c801 and 8a1e42a.

📒 Files selected for processing (1)
  • .github/workflows/duplicate_issue_detector.yml

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
.github/workflows/duplicate_issue_detector.yml (1)

5-5: ⚠️ Potential issue | 🟡 Minor

Avoid repeated bot runs on issue edits unless intentionally required.

At Line [5], edited causes the workflow to run on every issue modification, which can repeatedly post/update duplicate-detection output and labels for the same issue. Prefer opened only, or keep edited with concurrency keyed by issue number.

Suggested change (keep edited, prevent overlapping duplicate runs)
 name: Duplicate Issue Detector
 
 on:
   issues:
     types: [opened, edited]
 
+concurrency:
+  group: duplicate-issue-${{ github.event.issue.number }}
+  cancel-in-progress: true
+
 jobs:
   duplicate-issues:
Does actions-cool/issues-similarity-analysis deduplicate or suppress repeated comments when the same issue triggers multiple runs (e.g., opened + edited)?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/duplicate_issue_detector.yml at line 5, The workflow
currently triggers on types: [opened, edited], which causes duplicate runs on
every issue edit; either remove "edited" from the types array to only run on
opened events, or keep "edited" but add a concurrency block (e.g., concurrency:
{ group: "duplicate-issue-detector-${{ github.event.issue.number }}",
cancel-in-progress: true }) to ensure only one run per issue is active and
prevent repeated duplicate-detection comments/labels; update the types array or
add the concurrency section accordingly and ensure the group uses
github.event.issue.number to scope per-issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/duplicate_issue_detector.yml:
- Line 5: The workflow currently triggers on types: [opened, edited], which
causes duplicate runs on every issue edit; either remove "edited" from the types
array to only run on opened events, or keep "edited" but add a concurrency block
(e.g., concurrency: { group: "duplicate-issue-detector-${{
github.event.issue.number }}", cancel-in-progress: true }) to ensure only one
run per issue is active and prevent repeated duplicate-detection
comments/labels; update the types array or add the concurrency section
accordingly and ensure the group uses github.event.issue.number to scope
per-issue.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2738b424-a20f-4d74-93eb-456a903ef3e9

📥 Commits

Reviewing files that changed from the base of the PR and between 8a1e42a and 315d73c.

📒 Files selected for processing (1)
  • .github/workflows/duplicate_issue_detector.yml

@anvayeeem
Copy link
Copy Markdown
Author

name: Duplicate Issue Detector

on:
issues:
types: [opened, edited]

jobs:
duplicate-issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Check for Duplicate Issues
uses: actions-cool/issues-similarity-analysis@0a5ea21 # v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
filter-threshold: 0.65
title-excludes: 'bug, enhancement, feature request, feature, request, help, question'
comment-title: '### 🤖 Potential Duplicate Issues Detected'
comment-body: |
We noticed this issue might be a duplicate of an existing one.
Please review the issues listed above before proceeding.
If it is a duplicate, consider closing this issue and contributing
to the original instead.
> This is an automated suggestion — maintainers will make the final call.
since-days: 365
labels: 'duplicate'


---

**Reply to CodeRabbit with:**

Fixed! Pinned the action to the immutable commit SHA 0a5ea211e6a178915f0f754968fc94ff845bcb41 # v1 to prevent supply-chain risk.

@anvayeeem anvayeeem closed this Mar 27, 2026
@anvayeeem anvayeeem reopened this Mar 27, 2026
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