Repository navigation
📦🔧:import large GitHub files as raw content - #102
Conversation
Use an authenticated raw Contents API request when GitHub omits the body for files larger than one megabyte. Snapshot the path and ref across both requests and preserve byte decoding and request errors. Cover the fallback through the real client with mocked HTTP responses. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Codex:gpt-6-astra Fixes: #98
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthrough
ChangesLarge-file retrieval
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant fetchFileText
participant Octokit
participant GitHub as GitHub Contents API
fetchFileText->>Octokit: Request file metadata with repository, path, and optional ref
Octokit->>GitHub: Fetch file metadata
GitHub-->>Octokit: Return encoding none and omitted content
fetchFileText->>Octokit: Request raw content with the same location
Octokit->>GitHub: Fetch raw content
GitHub-->>Octokit: Return response stream
fetchFileText->>fetchFileText: Decode response as UTF-8
Merge Risk: ⚪ Minimal · up to The large-file fallback has no identified merge-blocking issue; it is ready for normal merge checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
GitHub omits inline content and reports
encoding: "none"for repository fileslarger than 1 MB, which made the importer pass an invalid encoding to Buffer.
This uses the same authenticated client to fetch raw bytes at the original ref,
then decodes them exactly as the inline path does. Mocked HTTP tests cover auth,
ref stability, JSON text, ordinary base64 files, and request/body failures.
Fixes #98.
Summary by CodeRabbit