Repository navigation
Fix: Handle large PR commit lists - #310
Merged
Merged
Conversation
|
@tykeal is attempting to deploy a commit to the DCO App Team on Vercel. A member of the Team first needs to authorize it. |
Escalate pull request commit gathering to GraphQL when the REST commit list reaches GitHub's 250-commit cap. Validate GraphQL pagination returns the full commit count before evaluating DCO. Incomplete lists now fail closed instead of passing silently. Closes dcoapp#308 Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
tykeal
force-pushed
the
fix/large-pull-request-commits
branch
from
July 29, 2026 19:30
91e6355 to
de0c47e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
test/index.test.js:308
- This test mocks the REST
pulls.listCommitscall as returning all 250 commits in a single response. In practice the endpoint is requested withper_page=100, so Octokit’spaginate()will only reach 250 via multiple pages +Linkheaders. Mocking pagination here would better exercise the real REST->GraphQL escalation trigger and avoid a false-positive test that would still pass even if pagination behavior regressed.
.get("/repos/robotland/test/pulls/113/commits")
.query({ per_page: "100" })
.reply(200, restCommits)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
eb-oss
approved these changes
Jul 29, 2026
This branch was successfully deployed
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.
Bug
GitHub caps the pull request commits endpoint at 250 commits, and pagination does not lift that cap. For pull requests with more than 250 commits, the app evaluated only the first 250 and reported a verdict as though the entire list had been seen. A commit missing its sign-off beyond position 250 was never examined, so the app could report a passing DCO check for a pull request that does not actually pass. That is a silent false pass on a compliance gate.
Fix
REST
pulls.listCommitsremains the primary path. When it returns exactly 250 commits, which is the truncation signal, the app escalates to the paginated GraphQLPullRequest.commitsconnection, which has no 250 cap, and evaluates the complete list. GraphQL commits are mapped into the same shapelib/dco.jsalready consumes so downstream behavior is unchanged.Fail-closed guarantee
If a complete, self-consistent commit list cannot be obtained, the app never reports a pass. It rejects a GraphQL
totalCountbelow 250, which would contradict what REST already proved, atotalCountthat changes between pages, duplicate commit SHAs, a cursor that does not advance, pagination exceeding the expected page count, and any GraphQL error or partial response. Completeness is validated on the count of unique commit SHAs, not merely the array length.No new permissions are required; GraphQL uses the existing
pull_requests: readpermission.The
merge_group/compareCommitspath is deliberately unchanged in this PR.Closes #308