Skip to content

fix: fetch the pull request diff via the uncapped compare endpoint - #152

Merged
bugale merged 2 commits into
mainfrom
bugale/compare-endpoint-diff
Aug 18, 2026
Merged

fix: fetch the pull request diff via the uncapped compare endpoint#152
bugale merged 2 commits into
mainfrom
bugale/compare-endpoint-diff

Conversation

@bugale

@bugale bugale commented Aug 18, 2026

Copy link
Copy Markdown
Owner

BEEP BOOP! I am Copilot using Bugale's account:

Two independent oversized-pull-request failures, one commit each:

  1. pulls.get with 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 with comment: true or onlyNew: true on 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). The compare endpoint 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.

  2. When findings DO exist on an oversized pull request, createReview rejects 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).

bugale and others added 2 commits August 18, 2026 14:59
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>
@bugale
bugale marked this pull request as ready for review August 18, 2026 16:32
@bugale
bugale merged commit f1a91bf into main Aug 18, 2026
26 checks passed
@bugale
bugale deleted the bugale/compare-endpoint-diff branch August 18, 2026 16:38
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 5.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant