Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented May 7, 2024

Summary by CodeRabbit

  • Documentation
    • Updated guides on permission checking and polymorphism to enhance understanding of API usage without database interaction and model restrictions.
    • Revised error handling documentation to adjust content position in the sidebar.
    • Added new sections in plugins documentation for standardizing hook signatures in SWR and Tanstack Query.
    • Introduced documentation for new APIs added to PrismaClient by ZenStack, focusing on permission verification.
    • Documented the addition of a new permission checker API in upgrade notes.
    • Included a new section for handling permission check requests in server adapters documentation.

@vercel
Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
zenstack-new-site ✅ Ready (Inspect) Visit Preview 2 resolved May 12, 2024 1:49pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 7, 2024

Walkthrough

The recent documentation updates across various files mainly enhance clarity and introduce new functionalities. Key changes include the introduction of the check API for permission verification without database queries, updates to hooks in plugins with detailed naming and parameter conventions, and adjustments in content structuring within the documentation. These updates aim to improve developer understanding and interaction with the ZenStack platform.

Changes

File Path Summary of Changes
.../check-permission.md Introduced check API guide for database-free permission checks.
.../polymorphism.md Clarified field access restrictions in concrete models.
.../error-handling.md Updated sidebar_position from 6 to 7.
.../plugins/swr.mdx Added conventions for Query and Mutation Hooks.
.../plugins/tanstack-query.mdx Standardized signatures for Query and Mutation Hooks.
.../prisma-client-ext.md Documented new APIs added to PrismaClient, including check API.
.../server-adapters/.../rpc.mdx Added section for handling [model]/check requests.
docs/upgrade.md Introduced a new Permission Checker API in preview.

Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between fb64c34 and 1f46b8a.
Files selected for processing (1)
  • docs/upgrade.md (1 hunks)
Additional Context Used
LanguageTool (8)
docs/upgrade.md (8)

Near line 16: Consider an alternative adjective to strengthen your wording.
Context: ...ore ambitious and desires to solve some deeper problems in modeling a database-centric...


Near line 24: It seems that the correct verb form here is “allow”.
Context: ...orphic Relations Polymorphic relations allows you to model relations over an "abstrac...


Near line 82: The phrase ‘in many cases’ is used quite frequently. Consider using a less frequent alternative to set your writing apart.
Context: ...uery cache. This feature is very useful in many cases, but it can't cover all cases. For exam...


Near line 105: Unpaired symbol: ‘'’ seems to be missing
Context: ...useBaseUrl('/img/zmodel-format-light.png'), dark: useBaseUrl('/img/zmodel...


Near line 106: Unpaired symbol: ‘'’ seems to be missing
Context: ... useBaseUrl('/img/zmodel-format-dark.png'), }} /> You can switch back to the...


Near line 217: Use “a” instead of ‘an’ if the following word doesn’t start with a vowel sound, e.g. ‘a sentence’, ‘a university’.
Context: ....role == ADMIN) } ``` You'll get an compile-time error if you pass an `user...


Near line 248: Consider using a different verb to strengthen your wording.
Context: ...ory before generating new files. Please make sure not to mix manually created files with ...


Near line 248: Possible typo: you repeated a word
Context: ...y created files with the generated ones to to avoid data loss. ::: #### 5.1 Zod Plug...


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

Out of diff range and nitpick comments (3)
docs/reference/runtime-api.md (3)

Line range hint 69-69: Consider rephrasing to "By default, all enhancements are applied." for clarity and grammatical correctness.

- By default all enhancements are applied.
+ By default, all enhancements are applied.

Line range hint 70-70: Consider using a more assertive verb such as "ensure" instead of "make sure" to strengthen the documentation.

- so please make sure you [turn that level on]
+ so please ensure you [turn that level on]

Line range hint 11-11: Adjust the heading level from h3 to h2 to maintain a proper incremental sequence in the document structure.

- ### enhance
+ ## enhance

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

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: 11

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: 7

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: 8

Out of diff range and nitpick comments (6)
docs/reference/error-handling.md (1)

Line range hint 29-37: Adjust the indentation of the unordered list for consistency.

- - `reason`
-     A string field indicating the detailed reason of the rejection. Its value can be one of the following:
-     - *ACCESS_POLICY_VIOLATION*
-         CRUD failed because of access policy violation.
-     - *RESULT_NOT_READABLE*
-         CRUD succeeded but the result was not readable (violating "read" access policies).
-     - *DATA_VALIDATION_VIOLATION*
-         CRUD failed because of a [data validation](./zmodel-language#data-validation) error.
+ - `reason`: A string field indicating the detailed reason of the rejection. Its value can be one of the following:
+   - *ACCESS_POLICY_VIOLATION*: CRUD failed because of access policy violation.
+   - *RESULT_NOT_READABLE*: CRUD succeeded but the result was not readable (violating "read" access policies).
+   - *DATA_VALIDATION_VIOLATION*: CRUD failed because of a [data validation](./zmodel-language#data-validation) error.
docs/reference/plugins/tanstack-query.mdx (5)

Line range hint 16-16: Correct the spelling of "checkout" to "check out" to use it as a verb.

- please checkout the
+ please check out the

Line range hint 184-184: Change "Todo" to "To-do" to correctly spell the noun form.

- fully functional Todo app example
+ fully functional To-do app example

Line range hint 295-295: Correct the usage of "otherwise" to improve readability.

- by Vite, otherwise you'll encounter errors when the SvelteKit server renders the app.
+ by Vite; otherwise, you'll encounter errors when the SvelteKit server renders the app.

Line range hint 442-442: Correct the verb form of "opt-in".

- mutation hooks allow you to opt-in to "automatic optimistic update"
+ mutation hooks allow you to opt in to "automatic optimistic update"

Line range hint 466-466: Correct the verb form of "opt-out".

- You can opt-out on a per-query basis
+ You can opt out on a per-query basis

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: 0

Out of diff range and nitpick comments (7)
docs/upgrade.md (7)

Line range hint 16-16: Consider using a stronger adjective than "deeper" to emphasize the extent of the problems being addressed.


Line range hint 24-24: Correct the verb form for better grammatical accuracy: change "allows" to "allow".

- Polymorphic relations allows you to model relations
+ Polymorphic relations allow you to model relations

Line range hint 82-82: Consider using a synonym for "in many cases" to enhance the writing style.


Line range hint 105-106: Fix the unpaired quotation marks in the image source paths.

- light: useBaseUrl('/img/zmodel-format-light.png'),
- dark: useBaseUrl('/img/zmodel-format-dark.png'),
+ light: useBaseUrl('/img/zmodel-format-light.png'),
+ dark: useBaseUrl('/img/zmodel-format-dark.png'),

Line range hint 217-217: Correct the article usage: change "an" to "a" before "compile-time error".

- You'll get an compile-time error if you pass an `user` object without the `role` field:
+ You'll get a compile-time error if you pass an `user` object without the `role` field:

Line range hint 248-248: Remove the repeated word "to" and consider using a stronger verb than "make sure".

- Please make sure not to mix manually created files with the generated ones to to avoid data loss.
+ Please ensure not to mix manually created files with the generated ones to avoid data loss.

Line range hint 200-200: Remove unnecessary trailing spaces.

- 

@ymc9 ymc9 merged commit 199e4a1 into main May 13, 2024
@ymc9 ymc9 deleted the docs/permission-checker branch May 13, 2024 11:52
@coderabbitai coderabbitai bot mentioned this pull request Nov 18, 2024
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