-
Notifications
You must be signed in to change notification settings - Fork 0
fix(review): a PR too big for GitHub to diff is reviewed anyway #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
9a43657
fix(review): a PR too big for GitHub to diff is reviewed anyway
jtomaszewski ea6457e
fix(review): a file that only moved is a rename, not a binary blob
jtomaszewski ace0e0e
fix(review): exactly 3000 changed files is doubt, not a proven loss
jtomaszewski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right that code and spec disagreed, and I fixed that on the spec side rather than the code side — reasoning, so you can push back if you disagree.
The condition the fallback actually means is "GitHub declined to render this diff because it is too big". GitHub signals that with the
too_largeerror code; 406 isNot Acceptable, a general status it can return for unrelated reasons. Matchingtoo_largematches the meaning, matching 406 matches the transport — so requiring the status would be the one that eventually falls back on something this was never for.The theoretical hole you name — some other
gh pr difffailure whose message happens to containtoo_large— needs GitHub to emit that token for a different refusal, which it does not today. And the blast radius if it ever did is small: the fallback immediately calls the files API, which fails the same way for a genuine auth or not-found error, so the run still fails rather than reviewing a fabricated diff. There is a test pinning that an auth failure throws instead of falling back.So the code is unchanged in behaviour, but it now says why in a comment, and
SPEC.md§11.2 no longer claims "a 406 is the only diff failure that falls back" — it says thetoo_largesignature is, and that the match is deliberately not on the status.ea6457e.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, since this merged with the thread still open: the guard is unchanged, matching GitHub's
too_largesignature rather than the 406 status, for the reason above — 406 isNot Acceptablegenerally,too_largeis emitted for this refusal and nothing else.Left unresolved deliberately rather than closed off, because it records a real design choice someone may want to revisit, not a loose end. If the status check is wanted after all it is a one-line change on top of
c50b803.