fix: detect merged PRs to externally-owned repos for open source scoring - #376
Open
janampatel wants to merge 1 commit into
Open
fix: detect merged PRs to externally-owned repos for open source scoring#376janampatel wants to merge 1 commit into
janampatel wants to merge 1 commit into
Conversation
GitHub enrichment only ever listed repos owned by the candidate
(GET /users/{username}/repos) and classified open_source vs
self_project by whether *other people* contributed to those owned
repos. It had no way to see PRs the candidate merged into someone
else's repo -- the actual definition of open source contribution --
so genuine external contributions made via the standard fork-and-PR
workflow were invisible to the scorer.
Add fetch_external_pr_contributions() using the Search API
(author:{username} type:pr is:merged), keep only PRs merged into
repos owned by someone else, and surface them as a new
"External Open Source Contributions" section in the GitHub data fed
to the evaluator. Update the open_source rubric to treat this as the
primary signal, ahead of the owned-repo contributor-count heuristic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Open source scoring only ever looks at repos the candidate owns (
GET /users/{username}/repos), and classifiesopen_sourcevsself_projectby whether other people contributed to those repos. It never checks whether the candidate contributed to someone else's repo, which is what open source contribution actually means for most people, since it's usually done via fork + PR rather than owning a popular repo.I hit this scoring my own resume: I have done several OS contributions, via a personal fork. The scorer gave me 5/35 on Open Source with "no contributions to other projects" as the evidence. Two reasons:
if repo.get("fork") and repo.get("forks_count", 0) < 5: continue— a personal contribution fork will basically always have 0 forks of its own.Fix
github.py: newfetch_external_pr_contributions(username), using the Search API (author:{username} type:pr is:merged) to find merged PRs, filtered to repos owned by someone else. Added tofetch_and_display_github_info()asexternal_contributions.transform.py: rendersexternal_contributionsinto the=== GITHUB DATA ===block so the evaluator actually sees it.roles/software_engineering_intern/criteria.jinja: treat this as the primary open-source signal, and only fall back to the old "self_project-only → cap at 10" rule when there's nothing here.Verification
Ran
python score.py resume/sample.pdf --role software_engineering_internagainst my own GitHub profile, before and after:Cross-checked the merged-PR count against the GitHub Search API directly.
black github.py transform.py --checkpasses.Note
Only counts merged PRs (
is:merged) — open/unreviewed PRs aren't counted, on purpose.