Repository navigation
fix(ci): handle oversized PR diff fallback safely - #9678
Open
Krrish Mittal (takyyon) wants to merge 1 commit into
Open
Krrish Mittal (takyyon) wants to merge 1 commit into
Krrish Mittal (takyyon) wants to merge 1 commit into
Conversation
Add a guarded fallback for the structured PR raw-diff-too-large 406 path so AI PR validation can gather bounded data from listFiles patches without relaxing normal raw-diff behavior.\n\nInclude strict regression coverage that executes the extracted workflow JavaScript and extracted bash snippet under pipefail, including large input and error-path contracts.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: c0d9bc12-a47f-4e97-9b1e-274b5574525d
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | No changes required. |
| Commit Type | ✅ | fix is correctly selected. |
| Risk Level | ✅ | Medium matches both the body and risk:medium label. |
| What & Why | ✅ | Explanation is clear and sufficiently detailed. |
| Impact of Change | ✅ | User, developer, and system impacts are covered. |
| Test Plan | ✅ | Unit tests are present in the diff and manual testing is documented. |
| Contributors | Add other contributors if applicable. | |
| Screenshots/Videos | ✅ | Correctly identified as not applicable. |
The PR title and body pass review. No required updates are needed.
Powered by: Logic App (fallback) | Last updated: Fri, 30 Oct 2026 16:45:50 GMT
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the oversized-pull-request validation changes.
No open issues 🎉
What changed in this PR
This PR repairs AI PR Validation for oversized pull requests while preserving normal diff handling and existing validation policy.
Changes:
- Falls back to bounded, paginated file patches only for GitHub’s structured oversized-diff error; other errors still propagate.
- Separates shell sampling reads to avoid SIGPIPE failures while retaining line and byte limits.
- Adds regression tests and runs them from the trusted checkout before gathering PR data.
| File | Description |
|---|---|
scripts/pr-ai-validation.test.mjs |
Tests fallback handling, sampling limits, failure propagation, and trusted-checkout configuration. |
.github/workflows/pr-ai-validation.yml |
Adds the guarded fallback, fixes shell sampling, and integrates regression tests. |
Review effort: Balanced
Krrish Mittal (takyyon)
requested a review
from Carlos Castro Trejo (ccastrotrejo)
October 30, 2026 17:38
This branch has not been 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.
Commit Type
Risk Level
What & Why
PR AI Validation fails before assessment when GitHub rejects a raw diff over 20,000 lines. This is the required-check failure observed on #9677.
Fall back to bounded, paginated native file patches only for the structured HTTP 406
PullRequest/diff/too_largeerror. Preserve normal raw-diff retrieval, explicitly identify unavailable patches, and propagate unrelated errors.Keep the existing 4,000-line gather bound and 2,000-line/100,000-byte prompt limits. Apply the line and byte limits through an intermediate temporary file instead of a producer pipe: large inputs otherwise cause SIGPIPE under Actions' strict Bash settings.
Run actual-workflow regression tests from the existing trusted checkout. Permissions, models, verdict handling and the
pull_request_targettrust boundary remain unchanged; no PR-head checkout is introduced.Impact of Change
Test Plan
Unit tests added/updated
E2E tests added/updated
Manual testing completed
Tested in: local focused workflow/test checks.
node --test scripts/pr-ai-validation.test.mjs: 30 passed, 0 failed.Tests execute the actual extracted workflow scripts, including strict Bash with two-megabyte inputs, pagination bounds, missing patches, exact line/byte limits, input/temp-file failures and trusted-checkout test wiring.
Contributors
Krrish Mittal (@takyyon)
Screenshots/Videos
N/A (CI workflow/test-only change).