Repository navigation
feat: implement public review functionality and enhance code review page: - #321
Conversation
…age: - Added new API endpoints for handling public reviews, including GET and POST methods for fetching and publishing reviews. - Created a dedicated review page for users to submit public GitHub pull request URLs and receive AI-generated reviews. - Updated the Code Review page links to direct users to the new review page for improved navigation. - Enhanced the review findings panel to display structured findings from the AI review process.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (32)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
| await tx.publicReviewCache.upsert({ where: { key }, create: { key, ...data }, update: data }) | ||
| return { leaseToken } | ||
| }, false), |
There was a problem hiding this comment.
Cache fills before review allowance When the supported AI limits are raised, 256 distinct reviews can fill the 24-hour cache while generation allowance remains. This check then rejects every new PR until an entry expires, despite the configured allowance permitting more reviews. Evict completed entries or align cache capacity with the supported limits.
| const tree = parseGithubData(z.object({ | ||
| truncated: z.boolean(), | ||
| tree: z.array(z.object({ path: z.string(), sha, type: z.string() })), | ||
| }), await github(`${path}/git/trees/${pr.base.sha}?recursive=1`)) | ||
| if (tree.truncated || tree.tree.length > PUBLIC_REVIEW_LIMITS.treeEntries) tooLarge() | ||
| const blobs = new Map(tree.tree.filter((item) => item.type === "blob").map((item) => [item.path, item.sha])) | ||
| for (const file of metadataOnlyFiles) { | ||
| const previousPath = file.previous_filename ?? (file.status === "unchanged" ? file.filename : undefined) | ||
| if (!previousPath || blobs.get(previousPath) !== file.sha) incompleteDiff() |
There was a problem hiding this comment.
Small PR requires entire tree A rename or copy without a text patch triggers a recursive fetch of the entire base repository tree. In a large repository, the tree can exceed the 10,000-entry or response-size limit even when the PR is within the advertised limits, so an otherwise eligible review is rejected. Validate the affected files without requiring the whole tree.
| setResult((current) => current ? { | ||
| ...current, | ||
| review: { ...current.review, status: "failed", review: message }, | ||
| } : null) | ||
| setPhase("failed") |
There was a problem hiding this comment.
Failed refresh discards completed review If “Check latest” fails, such as when the hourly loading limit has been reached, this handler replaces the completed review already on screen with the error text and marks it failed. The user loses access to that review and cannot publish it. Keep the completed result until a newer review loads successfully.
Description
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
bun testpassesbun run typecheckpassesbun run lintpasses (if applicable)Checklist: