Skip to content

feat: implement public review functionality and enhance code review page: - #321

Merged
yashdev9274 merged 1 commit into
mainfrom
supercode-cli
Oct 5, 2026
Merged

yashdev9274 merged 1 commit into
mainfrom
supercode-cli

Conversation

@yashdev9274

Copy link
Copy Markdown
Owner

Description

  • 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.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • bun test passes
  • bun run typecheck passes
  • bun run lint passes (if applicable)

Checklist:

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

…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.
@vercel

vercel Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
supercli Ready Ready Preview Oct 5, 2026 9:27am UTC
supercli-client Ready Ready Preview Oct 5, 2026 9:27am UTC
supercli-docs Ready Ready Preview Oct 5, 2026 9:27am UTC
vercel-supercodeai-integration Ready Ready Preview Oct 5, 2026 9:27am UTC

@coderabbitai

coderabbitai Bot commented Oct 5, 2026

Copy link
Copy Markdown

Review in Change Stack →

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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ebbba2a-21a0-44e5-82d6-e4a7af8f7ae3
📥 Commits

Reviewing files that changed from the base of the PR and between 6bfb694 and a983749.

📒 Files selected for processing (32)
  • apps/web/app/(pages)/code-review/page.tsx
  • apps/web/app/api/public-reviews/publish/route.ts
  • apps/web/app/api/public-reviews/route.ts
  • apps/web/app/review/page.tsx
  • apps/web/modules/ai/lib/generate-pr-review.ts
  • apps/web/modules/ai/lib/pr-review-generation.ts
  • apps/web/modules/bugs-caught/lib/parse-findings.test.ts
  • apps/web/modules/bugs-caught/lib/parse-findings.ts
  • apps/web/modules/pull-requests/components/pr-workspace.tsx
  • apps/web/modules/pull-requests/components/review-findings-panel.tsx
  • apps/web/modules/reviews/components/mermaid-diagram.tsx
  • apps/web/modules/reviews/public-pr-url.ts
  • apps/web/modules/reviews/public-review-backend.md
  • apps/web/modules/reviews/public-review-errors.ts
  • apps/web/modules/reviews/public-review-generation.ts
  • apps/web/modules/reviews/public-review-github.ts
  • apps/web/modules/reviews/public-review-page.tsx
  • apps/web/modules/reviews/public-review-publish-github.ts
  • apps/web/modules/reviews/public-review-publish-request.ts
  • apps/web/modules/reviews/public-review-publish-store.test.ts
  • apps/web/modules/reviews/public-review-publish-store.ts
  • apps/web/modules/reviews/public-review-publish.test.ts
  • apps/web/modules/reviews/public-review-publish.ts
  • apps/web/modules/reviews/public-review-quota-settings.test.ts
  • apps/web/modules/reviews/public-review-request.ts
  • apps/web/modules/reviews/public-review-service.ts
  • apps/web/modules/reviews/public-review-store.integration.test.ts
  • apps/web/modules/reviews/public-review-store.ts
  • apps/web/modules/reviews/public-review.css
  • apps/web/modules/reviews/public-review.test.ts
  • packages/db/prisma/migrations/20261005120000_public_reviews/migration.sql
  • packages/db/prisma/schema.prisma
 _________________________
< Think twice, code once. >
 -------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5 Tier: plus

[Critical risk] Adds database schema and public API endpoints for code reviews.

The PR should not merge until the supported higher-throughput configuration can generate reviews without filling the cache prematurely.

Findings

  1. P1 Cache fills before review allowance ▶
  2. P2 Small PR requires entire tree ▶
  3. P2 Failed refresh discards completed review ▶
Summary

The PR adds anonymous public-PR previews and AI reviews, cached quota-controlled generation, and an authenticated option to publish a generated review as a GitHub comment. It also adds a public review workspace and structured findings panel.

  • Cache capacity can stop new reviews before configured AI allowances are reached.
  • Large repository trees can prevent otherwise small metadata-only PRs from being reviewed.
  • A failed “Check latest” request discards a review already on screen.

Diagram

sequenceDiagram
  participant Browser
  participant API as Public review API
  participant GitHub
  participant Store
  participant AI
  Browser->>API: Preview PR URL
  API->>Store: Reserve fetch
  API->>GitHub: Fetch public PR and patches
  API->>Store: Read matching cached review
  API-->>Browser: Preview or completed review
  Browser->>API: Generate if uncached
  API->>Store: Reserve generation and quota
  API->>GitHub: Validate PR snapshot
  API->>AI: Generate review
  API->>Store: Save completed review
  API-->>Browser: Review and diff
  Browser->>API: Publish with signed-in session
  API->>Store: Validate cached review and reserve write
  API->>GitHub: Post or update user's comment
  API-->>Browser: Comment URL
Loading

Reviews (1) · Last reviewed commit: "feat: implement public review functional..."

Comment on lines +137 to +139
await tx.publicReviewCache.upsert({ where: { key }, create: { key, ...data }, update: data })
return { leaseToken }
}, false),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment on lines +238 to +246
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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Comment on lines +157 to +161
setResult((current) => current ? {
...current,
review: { ...current.review, status: "failed", review: message },
} : null)
setPhase("failed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

This branch was successfully deployed

4 active deployments
Preview – supercli — a9837491 Deployed Oct 5, 2026 by vercel[bot]
Preview – supercli-client — a9837491 Deployed Oct 5, 2026 by vercel[bot]
Preview – vercel-supercodeai-integration — a9837491 Deployed Oct 5, 2026 by vercel[bot]
Preview – supercli-docs — a9837491 Deployed Oct 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant