Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Nov 8, 2025

Summary by CodeRabbit

  • New Features

    • Added a prominent v3 call-to-action beside the existing "Get Started" and updated the homepage button layout for improved responsive spacing.
  • Documentation

    • Published a comprehensive v2→v3 migration guide with migration steps, examples, and FAQs.
    • Expanded error and API docs to introduce structured error reasons and to surface underlying database error codes.
    • Updated feature gaps and roadmap status (TanStack Query marked complete).

@vercel
Copy link

vercel bot commented Nov 8, 2025

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

Project Deployment Preview Comments Updated (UTC)
zenstack-new-site Ready Ready Preview Comment Nov 9, 2025 3:36am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Walkthrough

Adds a second CTA on the homepage, introduces a v2→v3 migration guide and tweaks an existing migration doc, defines structured ORM error types (class + enums), updates roadmap items, and extends REST/RPC API error docs to include DB error codes and typed error reasons.

Changes

Cohort / File(s) Change Summary
Homepage UI
src/pages/index.tsx
Replaced button container class with flex flex-wrap justify-center gap-4; added an outline-styled anchor CTA linking to /v3 placed beside the existing "Get Started →" button.
Migration Guides
versioned_docs/version-3.x/migrate-prisma.md, versioned_docs/version-3.x/migrate-v2.md
migrate-prisma.md: renamed "Feature Gap" to "Feature Gaps" and added a features table. Added migrate-v2.md: new comprehensive v2→v3 migration guide covering architecture, compatibility, Prisma/ZModel migrations, access control/policy changes, server adapters, client hooks, plugin system, examples, and FAQs.
ORM Error Documentation
versioned_docs/version-3.x/orm/errors.md
Added exported ORMError class and exported enums ORMErrorReason and RejectedByPolicyReason; documented fields such as model, dbErrorCode, dbErrorMessage, rejectedByPolicyReason, sql, and sqlParams.
Roadmap
versioned_docs/version-3.x/roadmap.md
Updated sidebar index value and marked "TanStack Query integration" as completed; added EOF newline.
API Handler Documentation
versioned_docs/version-3.x/service/api-handler/rest.md, versioned_docs/version-3.x/service/api-handler/rpc.md
REST: added dbErrorCode to the documented error object. RPC: replaced free-form cause/rejectReason with typed reason: ORMErrorReason and rejectReason?: RejectedByPolicyReason, added dbErrorCode?: unknown, and linked to ORM error enums.

Sequence Diagram(s)

(No sequence diagram provided — changes are documentation and small UI/markup edits without new runtime control-flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Files warranting extra attention:
    • versioned_docs/version-3.x/migrate-v2.md — long technical doc: verify examples, code snippets, and compatibility claims.
    • versioned_docs/version-3.x/orm/errors.md — confirm enum values and ORMError fields align with runtime/SDK contracts.
    • versioned_docs/version-3.x/service/api-handler/rpc.md & .../rest.md — ensure documented error shapes match actual API responses and client expectations.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'doc: v2 to v3 migration guide' directly reflects the main change: adding comprehensive v2 to v3 migration documentation (migrate-v2.md). The title is concise, clear, and accurately summarizes the primary purpose of the changeset.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/v2-migration

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 09bf784 and ed11b17.

📒 Files selected for processing (1)
  • versioned_docs/version-3.x/migrate-v2.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/migrate-v2.md

[style] ~219-~219: Consider using a less common alternative to make your writing sound more unique and professional.
Context: ...r that are planned to be removed in v3. Please feel free to share your thoughts about these decisio...

(FEEL_FREE_TO_STYLE_ME)


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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fd1902 and d5ec821.

📒 Files selected for processing (3)
  • versioned_docs/version-3.x/migrate-prisma.md (1 hunks)
  • versioned_docs/version-3.x/migrate-v2.md (1 hunks)
  • versioned_docs/version-3.x/roadmap.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • versioned_docs/version-3.x/migrate-prisma.md
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/migrate-v2.md

[style] ~183-~183: Consider using a less common alternative to make your writing sound more unique and professional.
Context: ...r that are planned to be removed in v3. Please feel free to share your thoughts about these decisio...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (6)
versioned_docs/version-3.x/roadmap.md (1)

2-2: Roadmap updates align with v3 documentation expansion.

The sidebar position reordering and TanStack Query integration status update are consistent with the broader migration guide introduction. Changes look good.

Also applies to: 13-13

versioned_docs/version-3.x/migrate-v2.md (5)

145-171: TanStack Query client API structure is well-documented.

The migration example clearly shows the structural change from flat hook exports (useFindManyUser) to schema-inferred client pattern (client.user.useFindMany). This aligns well with the roadmap completion status. Code examples are clear and practical.


43-116: Access policy migration section clearly outlines the plugin-based approach.

The three-step pattern for policy migration (install package → declare plugin → install runtime) is well-structured. The v2 vs. v3 code comparison for post-update policies effectively illustrates the breaking change from future().ownerId to before().ownerId semantics. Examples are helpful.


39-41: Verify Prisma migration guide completeness.

Line 41 references a separate Prisma Migration Guide at ./migrate-prisma.md. Ensure this guide covers the essential migration steps comprehensively, particularly database schema compatibility and feature gaps mentioned in line 33.

The migration guide refers to ./migrate-prisma.md for detailed Prisma migration instructions. Please confirm that this referenced file exists and contains complete migration guidance for replacing Prisma dependencies with ZenStack ORM.


118-143: Server adapter migration example requires API signature verification.

The code example shows RPCApiHandler and ZenStackMiddleware usage patterns. Verify that constructor signatures and method names (apiHandler, getClient) match the current implementation, particularly the renaming from getPrisma to getClient.


1-220: I need to verify a few more details about the documentation structure and API references:

Let me check for the orm/plugins directory and verify the plugin references:

Let me search the codebase for the orm/plugins directory structure and verify the plugin references:

All internal documentation links are valid and API signatures match implementation.

The verification confirms:

  • All referenced documentation files exist in the versioned_docs/version-3.x/ directory (migrate-prisma.md, orm/access-control/post-update.md, service/server-adapter.md, modeling/plugin.md)
  • check-permission.md and openapi.mdx files are present in the docs/ directory structure
  • The API signatures in the examples match v3 implementation patterns (e.g., AccessControlPlugin from @zenstackhq/runtime), and the migration guide's reference to PolicyPlugin from @zenstackhq/plugin-policy is appropriate for the v2-to-v3 migration context
  • The code examples showing ZenStackClient, $use(), and $setAuth() methods are consistent with v3 API patterns
  • The orm/plugins/ reference refers to the documentation category containing plugin documentation pages

No corrections needed to the migration guide content.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
versioned_docs/version-3.x/migrate-v2.md (2)

29-29: Resolve the unaddressed grammar error from prior review.

This issue was flagged in the previous review and remains unresolved. The phrase "only native the traditional TCP-based connection" contains a redundant descriptor.

-   For PostgreSQL, only native the traditional TCP-based connection is supported. Newer HTTP-based protocols, such as those supported by providers like Neon and Prisma PG, are not yet supported, but will be in the future.
+   For PostgreSQL, only the traditional TCP-based connection is supported. Newer HTTP-based protocols, such as those supported by providers like Neon and Prisma PG, are not yet supported, but will be in the future.

219-219: Resolve the unaddressed style issue from prior review.

This issue was flagged in the previous review and remains unresolved. The phrasing "Please feel free to share your thoughts" is too informal for technical documentation.

-This section lists v2 features that haven't been migrated to v3 yet, or that are planned to be removed in v3. Please feel free to share your thoughts about these decisions in [Discord](https://discord.gg/Ykhr738dUe), and we'll be happy to discuss them.
+This section lists v2 features that haven't been migrated to v3 yet, or that are planned to be removed in v3. We welcome feedback on these decisions in [Discord](https://discord.gg/Ykhr738dUe).
🧹 Nitpick comments (1)
versioned_docs/version-3.x/migrate-v2.md (1)

91-91: Clarify the before() function reference.

Line 91 mentions "you can use the before() function to refer to the 'before-update' state" but provides no signature or detailed documentation link. Consider linking to the post-update policy documentation for completeness.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5ec821 and 09bf784.

📒 Files selected for processing (1)
  • versioned_docs/version-3.x/migrate-v2.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
versioned_docs/version-3.x/migrate-v2.md

[style] ~219-~219: Consider using a less common alternative to make your writing sound more unique and professional.
Context: ...r that are planned to be removed in v3. Please feel free to share your thoughts about these decisio...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (1)
versioned_docs/version-3.x/migrate-v2.md (1)

66-89: Verify plugin initialization pattern is correct.

The code example at line 66–89 shows $use() and $setAuth() methods. Please confirm these match the actual v3 API and are not placeholders.

@ymc9 ymc9 merged commit 7979a01 into main Nov 9, 2025
4 checks passed
@ymc9 ymc9 deleted the docs/v2-migration branch November 9, 2025 03:36
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.

2 participants