Skip to content

fix: implement GitHub API-based transfer detection#28

Merged
Kavirubc merged 1 commit intomainfrom
fix/transfer-detection-api-check
Feb 4, 2026
Merged

fix: implement GitHub API-based transfer detection#28
Kavirubc merged 1 commit intomainfrom
fix/transfer-detection-api-check

Conversation

@Kavirubc
Copy link
Copy Markdown
Contributor

@Kavirubc Kavirubc commented Feb 4, 2026

Summary

Fixes #27 - Replaces time-based heuristic with proper GitHub API check to eliminate false positives when detecting transferred issues.

Problem

The previous implementation used a time-based heuristic (checking if an issue was created < 2 minutes ago) to detect transferred issues. This caused false positives, incorrectly skipping legitimate new issues like #38.

Solution

  • Added ListIssueEvents method to GitHub client for fetching issue timeline events
  • Updated Gatekeeper to store GitHub client from dependencies
  • Implemented checkIfRecentlyTransferred that queries the GitHub API for actual "transferred" events
  • Replaced CreatedAt time check with API-based detection that looks for transfer events within the last 2 minutes

Benefits

  • Eliminates false positives (legitimate new issues no longer incorrectly skipped)
  • Uses accurate GitHub event data instead of heuristics
  • Adds 100-200ms latency per issue but ensures correctness

Test Plan

  • Test with a real transferred issue (should be skipped)
  • Test with a new issue created < 2 minutes ago (should NOT be skipped)
  • Verify no transfer loops occur

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Enhanced GitHub issue detection to identify recently transferred issues more accurately using API-backed verification instead of inline heuristics.

Replaces time-based heuristic with proper GitHub API check to eliminate
false positives when detecting transferred issues.

Changes:
- Added ListIssueEvents method to GitHub client for fetching issue timeline
- Updated Gatekeeper to store GitHub client from dependencies
- Implemented checkIfRecentlyTransferred that queries actual transfer events
- Replaced CreatedAt time check with API-based detection
- Fixes issue #27 where legitimate new issues were incorrectly skipped

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 4, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This change addresses false positives in transfer loop prevention by replacing an overly aggressive time-based heuristic with GitHub API timeline checks. It adds a method to fetch issue events and modifies Gatekeeper to distinguish transferred issues from legitimately created ones.

Changes

Cohort / File(s) Summary
GitHub Client Enhancement
internal/integrations/github/client.go
Added ListIssueEvents method to paginate and aggregate issue timeline events from GitHub API with PerPage=100.
Gatekeeper API Integration
internal/steps/gatekeeper.go
Integrated GitHub client into Gatekeeper struct; replaced inline skip logic with new checkIfRecentlyTransferred method that queries API for recent "transferred" events within 2-minute window to accurately identify transferred issues.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • simili-bot#26: Introduces Issue.EventAction parsing that enables this PR's conditional checks to distinguish between "transferred" and "opened" event actions.

Poem

🐰 A heuristic hopped too fast, catching new issues in its net,

So we called the GitHub API—no false alarms yet!

With timeline events in hand, we tell transferred from new,

Transfer loops prevented, and legit issues get through! 🚀

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/transfer-detection-api-check

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


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

@Kavirubc Kavirubc merged commit a8f96d8 into main Feb 4, 2026
3 of 4 checks passed
@Kavirubc Kavirubc deleted the fix/transfer-detection-api-check branch February 4, 2026 15:38
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.

Fix false positive in transfer loop prevention

1 participant