fix(review-agent): fetch private GitHub PR diffs via API#1352
fix(review-agent): fetch private GitHub PR diffs via API#1352BashOpsDev wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthrough
ChangesAuthenticated PR diff fetching via Octokit Pulls API
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/web/src/features/agents/review-agent/nodes/githubPrParser.ts`:
- Around line 15-20: The local variable `pull_number` violates
TypeScript/JavaScript naming conventions which require camelCase for
identifiers. Rename the local variable from `pull_number` to `pullNumber` on the
line where it is assigned from `pullRequest.number`. Then in the octokit.request
call, update the parameter mapping to use `pull_number: pullNumber` to keep the
API field name in snake_case while the local variable follows camelCase
conventions.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 963e0c7a-35ed-491d-b985-0d8e52b18c72
📒 Files selected for processing (2)
packages/web/src/features/agents/review-agent/nodes/githubPrParser.test.tspackages/web/src/features/agents/review-agent/nodes/githubPrParser.ts
Summary
Fixes #1277.
The Review Agent currently fetches pull request diffs using the
diff_urlreturned by GitHub. For private repositories, this URL can return404 Not Foundeven when the GitHub App token has permission to access the pull request through the GitHub API.This change updates
githubPrParserto fetch diffs through the GitHub Pull Requests API using theapplication/vnd.github.diffaccept header. This allows authenticated access to PR diffs in private repositories.Changes
pullRequest.diff_urlGET /repos/{owner}/{repo}/pulls/{pull_number}application/vnd.github.diffTesting
cd packages/web yarn vitest githubPrParserResult:
Summary by CodeRabbit
Acceptheader, rather than relying on the pull request’s direct diff URL.