fix: fetch the pull request diff via the uncapped compare endpoint - #152
Merged
Conversation
The pull request diff endpoint rejects large diffs outright (HTTP 406, 'diff exceeded the maximum number of lines (20000)' on older GitHub Enterprise Server versions, 'maximum number of files (300)' on 3.18), which failed the action on any oversized pull request. The compare endpoint serves the identical three-dot diff with no such cap (verified at 3,000 files / 558K lines on GHES 3.18). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
GitHub rejects inline review threads on files whose diff it refuses to render in oversized pull requests (HTTP 422, 'review thread path diff too large'), which failed the whole step even though the SARIF, summary and failure outputs were unaffected. Posting the comments is best-effort decoration; warn and continue instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🎉 This PR is included in version 5.1.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
BEEP BOOP! I am Copilot using Bugale's account:
Two independent oversized-pull-request failures, one commit each:
pulls.getwith the diff media type hard-fails on large pull requests (HTTP 406,code: too_large): older GHES rejects >20,000 lines, GHES 3.18 rejects >300 files. This failed every invocation withcomment: trueoronlyNew: trueon oversized pull requests (observed in sentinel-one/winagent: a ~760-file reformat failed Markdownlint, three blackbox lints and the clang-format lint solely in bugalint's step). Thecompareendpoint returns the identical three-dot diff with no cap - verified on GHES 3.18 at 3,000 files / 558K diff lines. Two API calls instead of one.When findings DO exist on an oversized pull request,
createReviewrejects inline threads on files whose diff GitHub refuses to render (HTTP 422, 'review thread path diff too large... diff hunk can't be blank'), failing the step even though SARIF/summary/fail outputs were unaffected. Comment posting is best-effort decoration: warn and continue.All 70 tests pass, dist rebuilt. Validated end to end on sentinel-one/winagent#32095 (759-file / 74.7K-line reproduction).