fix(github): paginate listCommits to return all PR commits#836
Merged
Conversation
🎉 Happy commit!
|
gh-counterPR gate
Repo dashboard
Reported by gh-counter |
Code Metrics Report
Details | | main (fd2ef70) | #836 (e79986c) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 99.1% | 99.2% | +0.0% |
| Files | 5 | 5 | 0 |
| Lines | 122 | 131 | +9 |
+ | Covered | 121 | 130 | +9 |
- | Code to Test Ratio | 1:0.5 | 1:0.5 | -0.1 |
| Code | 1598 | 1630 | +32 |
+ | Test | 898 | 912 | +14 |
| Test Execution Time | 1s | 1s | 0s |Code coverage of files in pull request scope (100.0% → 100.0%)
Reported by octocov |
gh-build-size
Reported by gh-build-size |
getCommitIds called pulls.listCommits without per_page or pagination, so only the first 30 commits were returned. PRs with more than 30 commits silently dropped later commits from rule evaluation. Switch to octokit.paginate so all pages are fetched, matching the existing per_page: 100 pattern used for comment listing.
kitsuyui
force-pushed
the
fix/audit-getcommitids-no-pagination-001
branch
from
May 26, 2026 14:19
78d6bb9 to
a6303b3
Compare
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.
Summary
getCommitIdscalledpulls.listCommitswithoutper_pageor pagination, so only the first 30 commits (GitHub's default) were returnedoctokit.paginatewithper_page: 100so all pages are fetched regardless of PR sizeChanges
src/github.ts: replaceoctokit.pulls.listCommitswithoctokit.paginate(octokit.pulls.listCommits, { per_page: 100 })src/github.spec.ts: update mock and assertion to usepaginate; add a test for multi-page commit listsdist/: rebuiltTest plan
bun run test)biome checkpasses with no fixes appliedmadge --circular src/reports no circular dependenciesbun run build)