Skip to content

fix: paginate PR file fetch for scoring accuracy#274

Open
taooutsider wants to merge 1 commit intoentrius:testfrom
taooutsider:codex/sn74-pr-files-pagination
Open

fix: paginate PR file fetch for scoring accuracy#274
taooutsider wants to merge 1 commit intoentrius:testfrom
taooutsider:codex/sn74-pr-files-pagination

Conversation

@taooutsider
Copy link

Summary

  • paginate GET /repos/{owner}/{repo}/pulls/{number}/files using per_page=100 + page
  • aggregate all changed files before scoring
  • preserve existing retry/backoff behavior on transient failures

Why

GitHub returns only 30 files by default for PR file listings. For PRs with many changed files, scoring could miss file diffs and undercount contribution value.

Changes

  • update get_pull_request_file_changes() to fetch all pages
  • add tests for:
    • multi-page aggregation
    • retry when page 2 fails, restarting from page 1

Validation

  • pytest -q tests/utils/test_github_api_tools.py -k FileChangesRetryLogic
  • result: 10 passed

@taooutsider
Copy link
Author

This fix prevents truncated PR file lists when changed files > 30 (GitHub default), which can under-score larger contributions. Happy to adjust if you prefer Link-header based pagination.

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