Skip to content

Conversation

@Mohd-Mursaleen
Copy link

PR Description

Fixes the fork contribution detection logic that was missing legitimate open source contributions.

Fixes #149

How the Fix Works

The standard open source workflow is: fork repository → make changes → create PR → get merged. However, the current system was skipping all forks with low fork counts, completely missing these contributions.

The Problem: When a developer contributes to a major project like React, they fork it to their account, make changes, and submit a PR. Their fork typically has 0 forks (it's just a working copy), so the old logic skipped it entirely.

The Solution: Instead of checking the fork's popularity, we now check if the developer actually appears in the original repository's contributors list. If they do, we count it as a legitimate open source contribution using the original repo's significance (stars/forks).

Flow Diagram

Before (Broken):
User Repos → Find Fork → fork_count < 5? → SKIP → Miss Real Contribution

After (Fixed):
User Repos → Find Fork → Get Original Repo → Check Contributors → User Found? → Count as Open Source

Changes Made

  • For forks: Check if user appears in original repo's contributors list
  • For regular repos: Keep existing contributor count logic
  • API Usage: Use /repos/{owner}/{repo}/contributors to verify actual contributions
  • Scoring: Use original repository's stats (stars/forks) instead of fork's stats

Example Impact

  • Before: Developer's React fork (0 forks) → SKIPPED
  • After: Developer found in React contributors → Counted as contribution to 86k star project

This ensures developers following proper open source workflow get fair credit for their contributions.

Testing & Validation

Smoke Tests Performed:

  • ✅ PDF to Markdown extraction
  • ✅ Section extraction to JSON Resume
  • ✅ GitHub enrichment with fork detection on test username
  • ✅ Evaluation to JSON with required fields

Provider Testing:

  • ✅ Tested with Ollama using default local model
  • ✅ Verified GitHub API integration with real fork scenarios

Manual Validation:

  • ✅ Ran CLI on sample resumes with fork repositories
  • ✅ Verified proper classification of open source vs personal projects
  • ✅ Confirmed API error handling and fallback behavior

@Mohd-Mursaleen
Copy link
Author

@sp2hari @anxkhn-hacker
Review please.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Fix fork contribution detection in GitHub analysis

1 participant