Skip to content

Fix duplicate issue detection logic#1273

Merged
rohan-pandeyy merged 3 commits into
AOSSIE-Org:mainfrom
DhruvK278:patch-1
May 23, 2026
Merged

Fix duplicate issue detection logic#1273
rohan-pandeyy merged 3 commits into
AOSSIE-Org:mainfrom
DhruvK278:patch-1

Conversation

@DhruvK278

@DhruvK278 DhruvK278 commented May 22, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Exclude the newly opened issue from the semantic duplicate comparison set to prevent self-matching and false duplicate detection.

Fixes #1272

Screenshots/Recordings:

https://drive.google.com/file/d/1ir6AoR43aPjuTA1XqMDoogqa9GIscX1t/view?usp=sharing

Before

image

After

No wrong identification of duplicate issue

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: NONE

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Bug Fixes

    • Improved duplicate issue detection by excluding pull requests and the current issue from comparisons, reducing false positives.
  • Chores

    • Enhanced diagnostic output for the duplicate detection process: clearer threshold reporting, per-issue counts, and per-candidate similarity details in logs to aid troubleshooting.

Review Change Stack

@github-actions github-actions Bot added CI/CD bug Something isn't working labels May 22, 2026
@DhruvK278

Copy link
Copy Markdown
Contributor Author

@rohan-pandeyy Please review it. Thanks

@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Exclude the current issue from the upstream comparison set and add debug prints in the Python similarity step: log the configured threshold, current issue id and candidate count, and per-candidate (issue number, score, title) diagnostics before writing matches.json.

Changes

Duplicate Detection Fix

Layer / File(s) Summary
Upstream issue filter fix
.github/workflows/duplicate_issue_detector.yaml
The upstream issues filter was updated to exclude pull requests and the current issue (i.number !== issue.number) when building the candidate set for semantic comparison.
Similarity diagnostics added
.github/workflows/duplicate_issue_detector.yaml
Added debug prints: the configured threshold, current issue number and count of loaded candidates, and per-candidate logs (issue number, similarity score, title) before applying the threshold to generate matches.json.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AOSSIE-Org/PictoPy#1175: Both PRs modify the duplicate issue detector workflow's upstream filtering and/or candidate comparison logic.

Suggested labels

Python

Suggested reviewers

  • rohan-pandeyy
  • rahulharpal1603

Poem

A rabbit scanned the issue stream with care,
Removed the mirror reflecting there.
It printed scores and numbers bright,
So duplicates no longer match in sight.
Hop, debug, ship — the workflow's fair! 🐇✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix duplicate issue detection logic' clearly and specifically describes the main change - fixing the logic that prevents self-matching in duplicate detection.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #1272: it excludes the newly opened issue from semantic duplicate comparison using i.number !== issue.number and includes diagnostic output.
Out of Scope Changes check ✅ Passed All changes in the GitHub Actions workflow are directly scoped to fixing the duplicate issue detection logic as defined in issue #1272; no unrelated modifications present.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@rohan-pandeyy

Copy link
Copy Markdown
Member

Hi @DhruvK278, could you please test this implementation on your fork branch and share a screen recording here?

Verify the following:

  1. Open an issue and verify the changes.
  2. Open another similar issue and show that only one issue is marked as a duplicate
  3. Open a third issue that is unrelated to the previous two issues

@DhruvK278

Copy link
Copy Markdown
Contributor Author

Hi @DhruvK278, could you please test this implementation on your fork branch and share a screen recording here?

Verify the following:

  1. Open an issue and verify the changes.
  2. Open another similar issue and show that only one issue is marked as a duplicate
  3. Open a third issue that is unrelated to the previous two issues

here is the working test:
https://drive.google.com/file/d/1ir6AoR43aPjuTA1XqMDoogqa9GIscX1t/view?usp=sharing

@rohan-pandeyy rohan-pandeyy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for your contribution! @DhruvK278

@rohan-pandeyy rohan-pandeyy merged commit d1f22a2 into AOSSIE-Org:main May 23, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Exclude Current Issue from Semantic Duplicate Matching

2 participants