Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev to main (v2.13.0) #2057

Merged
merged 10 commits into from
Mar 24, 2025
Merged

merge dev to main (v2.13.0) #2057

merged 10 commits into from
Mar 24, 2025

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Mar 24, 2025

No description provided.

Copy link
Contributor

coderabbitai bot commented Mar 24, 2025

📝 Walkthrough

Walkthrough

This pull request updates the project version and refines several internal functionalities. The version in the gradle build file is incremented. Export statements in TypeScript files have been modified, and query‐building methods across runtime modules now handle missing parameters more safely and consistently. Logger usage has been reworked between policy and query utilities. Enhancements in schema validation and name resolution have been introduced, and a range of new and updated test cases cover nested updates, policy enforcement, and regression issues.

Changes

File(s) Affected Change Summary
packages/ide/jetbrains/build.gradle.kts Version bump: updated project version from "2.12.3" to "2.13.0".
packages/runtime/res/model-meta.d.ts Export change: replaced wildcard export with a default export from .zenstack/model-meta.
packages/runtime/src/enhancements/node/{delegate.ts, policy/handler.ts, query-utils.ts} Query/build enhancements: updated methods to safely clone where clauses (using ?? {}), pass the database (db) context to buildReversedQuery, convert calls to asynchronous, and (in query-utils.ts) initialize a new Logger instance and rename unsafeOperation to uncheckedOperation.
packages/runtime/src/enhancements/node/policy/policy-utils.ts Removed logging: eliminated Logger import, related property, and instantiation from the PolicyUtil class.
packages/schema/src/language-server/validator/function-invocation-validator.ts,
packages/sdk/src/validation.ts
Validation improvements: added private methods (getExpressionContext and isStaticFunctionCall) for determining expression contexts and static invocation checks; isValidationAttribute is now exported.
packages/schema/src/plugins/{enhancer/enhance/index.ts, prisma/schema-generator.ts, zod/transformer.ts} Schema plugin updates: added a reversed name mapping (reversedShortNameMap) with a new resolveName helper in the enhancer; corrected Boolean default value initialization from a string to a boolean; refined optional field handling in Zod schema generation.
packages/server/src/api/rest/index.ts Improved count query: applied nullish coalescing (args.where ?? {}) to ensure a valid object is passed to prisma[type].count.
packages/testtools/src/schema.ts Test tools update: ensured previewFeatures defaults to ["strictUndefinedChecks"] when not provided.
tests/integration/tests/enhancements/{with-delegate/enhanced-client.test.ts, with-delegate/utils.ts, with-policy/unique-as-id.test.ts, plugins/zod.test.ts} Test enhancements: modified nested update tests to create users and set explicit fields; added an email field to the User model; introduced tests for nested update scenarios and for verifying optional handling of @json fields with default values.
tests/regression/tests/{issue-1964.test.ts, issue-1984.test.ts, issue-1994.test.ts, issue-2038.test.ts, issue-765.test.ts} Regression tests: introduced several new test files and cases addressing issues related to record updates, policy enforcement, unique constraints, default value propagation via auth().flag, and schema loading adjustments with previewFeatures.

Sequence Diagram(s)

Loading
sequenceDiagram
  participant Client
  participant DelegateHandler
  participant QueryUtils
  participant Database

  Client->>DelegateHandler: Request update/delete (optional where clause)
  Note right of DelegateHandler: Clone where clause using `?? {}`
  DelegateHandler->>QueryUtils: Call buildReversedQuery(db, context, ...)
  QueryUtils->>Database: Execute query (e.g., findUniqueOrThrow)
  Database-->>QueryUtils: Return query result
  QueryUtils-->>DelegateHandler: Return reversed query details
  DelegateHandler-->>Client: Complete operation
Loading
sequenceDiagram
  participant Client
  participant PolicyHandler
  participant QueryUtils
  participant Database

  Client->>PolicyHandler: Send request for create/update/delete with policy check
  PolicyHandler->>QueryUtils: Invoke async buildReversedQuery(db, context, ...)
  QueryUtils->>Database: Query for necessary keys/records
  Database-->>QueryUtils: Return query information
  QueryUtils-->>PolicyHandler: Provide reversed query data
  PolicyHandler-->>Client: Process policy enforcement and return response

Possibly related PRs

  • chore: bump version #2055: Both PRs update the version number in build.gradle.kts, specifically from "2.12.3" to "2.13.0", reflecting a release increment.
  • chore: bump version #2031: This PR also involves modifications to build.gradle.kts with a version change, indicating a direct code-level relationship.
  • merge dev to main (v2.2.4) #1527: Involves a similar version update in build.gradle.kts, directly relating to the changes in this pull request.

📜 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 a4acf35 and 718fd67.

⛔ Files ignored due to path filters (13)
  • package.json is excluded by !**/*.json
  • packages/ide/jetbrains/package.json is excluded by !**/*.json
  • packages/language/package.json is excluded by !**/*.json
  • packages/misc/redwood/package.json is excluded by !**/*.json
  • packages/plugins/openapi/package.json is excluded by !**/*.json
  • packages/plugins/swr/package.json is excluded by !**/*.json
  • packages/plugins/tanstack-query/package.json is excluded by !**/*.json
  • packages/plugins/trpc/package.json is excluded by !**/*.json
  • packages/runtime/package.json is excluded by !**/*.json
  • packages/schema/package.json is excluded by !**/*.json
  • packages/sdk/package.json is excluded by !**/*.json
  • packages/server/package.json is excluded by !**/*.json
  • packages/testtools/package.json is excluded by !**/*.json
📒 Files selected for processing (22)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/runtime/res/model-meta.d.ts (1 hunks)
  • packages/runtime/src/enhancements/node/delegate.ts (4 hunks)
  • packages/runtime/src/enhancements/node/policy/handler.ts (12 hunks)
  • packages/runtime/src/enhancements/node/policy/policy-utils.ts (0 hunks)
  • packages/runtime/src/enhancements/node/query-utils.ts (3 hunks)
  • packages/schema/src/language-server/validator/function-invocation-validator.ts (5 hunks)
  • packages/schema/src/plugins/enhancer/enhance/index.ts (9 hunks)
  • packages/schema/src/plugins/prisma/schema-generator.ts (1 hunks)
  • packages/schema/src/plugins/zod/transformer.ts (1 hunks)
  • packages/sdk/src/validation.ts (1 hunks)
  • packages/server/src/api/rest/index.ts (1 hunks)
  • packages/testtools/src/schema.ts (1 hunks)
  • tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts (1 hunks)
  • tests/integration/tests/enhancements/with-delegate/utils.ts (1 hunks)
  • tests/integration/tests/enhancements/with-policy/unique-as-id.test.ts (1 hunks)
  • tests/integration/tests/plugins/zod.test.ts (1 hunks)
  • tests/regression/tests/issue-1964.test.ts (1 hunks)
  • tests/regression/tests/issue-1984.test.ts (1 hunks)
  • tests/regression/tests/issue-1994.test.ts (1 hunks)
  • tests/regression/tests/issue-2038.test.ts (1 hunks)
  • tests/regression/tests/issue-765.test.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/runtime/src/enhancements/node/policy/policy-utils.ts
🧰 Additional context used
🧬 Code Definitions (6)
packages/schema/src/plugins/prisma/schema-generator.ts (1)
packages/schema/src/plugins/prisma/prisma-builder.ts (1)
  • AttributeArgValue (231-289)
tests/regression/tests/issue-1964.test.ts (1)
packages/testtools/src/schema.ts (1)
  • loadSchema (163-369)
tests/integration/tests/plugins/zod.test.ts (1)
packages/testtools/src/schema.ts (1)
  • loadSchema (163-369)
packages/schema/src/language-server/validator/function-invocation-validator.ts (2)
packages/sdk/src/utils.ts (1)
  • getFunctionExpressionContext (429-443)
packages/sdk/src/validation.ts (1)
  • isValidationAttribute (10-12)
packages/runtime/src/enhancements/node/query-utils.ts (7)
packages/runtime/src/enhancements/edge/query-utils.ts (1)
  • QueryUtils (18-297)
packages/runtime/src/enhancements/edge/logger.ts (1)
  • Logger (8-66)
packages/runtime/src/enhancements/node/logger.ts (1)
  • Logger (8-66)
packages/runtime/src/types.ts (2)
  • DbClientContract (91-93)
  • CrudContract (86-86)
packages/runtime/src/enhancements/node/create-enhancement.ts (1)
  • InternalEnhancementOptions (31-64)
packages/runtime/src/enhancements/edge/utils.ts (1)
  • formatObject (9-11)
packages/runtime/src/enhancements/node/utils.ts (1)
  • formatObject (9-11)
tests/integration/tests/enhancements/with-policy/unique-as-id.test.ts (1)
packages/testtools/src/schema.ts (1)
  • loadSchema (163-369)
🪛 Biome (1.9.4)
packages/runtime/src/enhancements/node/delegate.ts

[error] 1029-1029: Avoid the delete operator which can impact performance.

Unsafe fix: Use an undefined assignment instead.

(lint/performance/noDelete)

⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: build-test (20.x)
  • GitHub Check: OSSAR-Scan
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: OSSAR-Scan
🔇 Additional comments (51)
tests/integration/tests/enhancements/with-delegate/utils.ts (1)

4-4: Good addition of email field to User model

Adding an email field with @unique constraint is a good practice for user models, allowing for proper user identification and preventing duplicate registrations. The field is correctly defined as nullable with the appropriate unique constraint.

packages/ide/jetbrains/build.gradle.kts (1)

12-12: Version bump looks good

The version increment from 2.12.3 to 2.13.0 follows semantic versioning principles, appropriately indicating a minor release with new features. This aligns with the PR purpose of merging development changes to main.

packages/runtime/res/model-meta.d.ts (1)

1-1:

❓ Verification inconclusive

Changed export pattern from wildcard to default export

This change modifies how consumers will need to import from this module. Instead of importing named exports directly, they'll now need to import the default export. Ensure all import statements across the codebase have been updated accordingly.


🏁 Script executed:

#!/bin/bash
# Find all imports from model-meta to verify they've been updated
rg -l "from ['\"].*model-meta['\"]" --type ts

Length of output: 539


Action Required: Update Import Statements for "model-meta"

The export in packages/runtime/res/model-meta.d.ts now uses a default export:

export { default } from '.zenstack/model-meta';

This change means that all consumers of model-meta must import it using default import syntax. Please double-check and, if necessary, update the following files to ensure they no longer rely on named exports:

  • packages/runtime/src/cross/index.ts
  • packages/runtime/src/cross/nested-write-visitor.ts
  • packages/runtime/src/cross/query-analyzer.ts
  • packages/runtime/src/cross/nested-read-visitor.ts
  • packages/plugins/swr/tests/react-hooks.test.tsx
  • packages/schema/src/plugins/enhancer/index.ts
  • packages/schema/src/plugins/enhancer/enhance/index.ts
  • packages/plugins/tanstack-query/tests/react-hooks.test.tsx
  • packages/plugins/tanstack-query/tests/react-hooks-v5.test.tsx
  • packages/runtime/res/model-meta.d.ts (the export file itself)

For example, change any statements like:

import { modelMeta } from 'model-meta';

to use the default import:

import modelMeta from 'model-meta';

Please verify that every instance in the codebase is updated accordingly.

packages/sdk/src/validation.ts (1)

10-10: Good refactoring to export validation helper

Making isValidationAttribute public promotes code reuse across modules. This function appears to be used by the hasValidationAttributes function and now can be used by other modules without duplicating the logic.

packages/testtools/src/schema.ts (1)

98-103: Default to "strictUndefinedChecks" preview feature.

This change ensures Prisma will always have a preview feature defined, defaulting to "strictUndefinedChecks" when no preview features are explicitly provided. This improves type safety by enabling stricter checking of undefined values during compilation.

tests/regression/tests/issue-2038.test.ts (1)

1-26: Good regression test for auth().flag default values.

This test verifies that model fields with default values referencing auth properties (like @default(auth().flag)) correctly resolve when creating new entities. The test structure is clean and clear, properly testing the issue reported in #2038.

packages/schema/src/plugins/prisma/schema-generator.ts (1)

896-896: Correct boolean type usage for better type safety.

Changed from using string 'false' to boolean false for Boolean field default values, which is more type-correct. The AttributeArgValue class expects a boolean value when the type is 'Boolean', and this change aligns with that expectation.

packages/server/src/api/rest/index.ts (1)

681-681: Improved query robustness with nullish coalescing.

Adding the nullish coalescing operator ensures that where is always a valid object, even when args.where is null or undefined. This defensive programming technique prevents potential runtime errors when building queries with optional filters.

tests/regression/tests/issue-765.test.ts (1)

24-27: Updated function call to match new loadSchema interface.

The loadSchema function call has been updated to include an options object with an empty previewFeatures array. This change aligns with the updated function signature in the @zenstackhq/testtools package.

packages/runtime/src/enhancements/node/policy/handler.ts (12)

812-813: Updated buildReversedQuery call to include db parameter and await.

The buildReversedQuery method call now includes a database client parameter and is properly awaited, reflecting a change in the method's signature to support asynchronous database operations.


888-889: Updated buildReversedQuery call to include db parameter and await.

Similar to other instances, this call has been updated to include the database client and is awaited appropriately.


913-914: Updated buildReversedQuery call to include db parameter and await.

This call has been updated to match the new method signature, ensuring the database client is available for internal operations.


939-940: Updated buildReversedQuery call to include db parameter and await.

The method call now includes the db parameter and is properly awaited for the unique filter generation.


1000-1001: Updated buildReversedQuery call to include db parameter and await.

Another instance of the updated method call, now with the db parameter and await.


1030-1031: Updated buildReversedQuery call to include db parameter and await.

Consistent update to include the database client and await the operation result.


1069-1070: Updated buildReversedQuery call to include db parameter and await.

The method call now includes the database context and properly awaits the asynchronous operation.


1093-1095: Improved null handling with nullish coalescing operator.

This change ensures that when args.where is undefined, it defaults to an empty object, preventing potential runtime errors when accessing properties of undefined.


1146-1147: Updated buildReversedQuery call to include db parameter and await.

Consistent with other updates, ensuring database context is available for query building.


1165-1166: Updated buildReversedQuery call to include db parameter and await.

Another instance of the method signature update to support async database operations.


1182-1183: Updated buildReversedQuery call to include db parameter and await.

The final instance of updating the method call to include database context and await.


1582-1590: Improved null handling in deleteMany with nullish coalescing.

This change ensures robust handling of undefined values for args.where, preventing potential runtime errors when working with candidate selection.

-                    this.logger.info(
-                        `[policy] \`findMany\` ${this.model}: ${formatObject({
-                            where: args.where,
-                            select: candidateSelect,
-                        })}`
-                    );
-                    const candidates = await tx[this.model].findMany({
-                        where: args.where,
-                        select: candidateSelect,
-                    });
+                    this.logger.info(
+                        `[policy] \`findMany\` ${this.model}: ${formatObject({
+                            where: args.where ?? {},
+                            select: candidateSelect,
+                        })}`
+                    );
+                    const candidates = await tx[this.model].findMany({
+                        where: args.where ?? {},
+                        select: candidateSelect,
+                    });
tests/integration/tests/plugins/zod.test.ts (1)

1101-1123: Added test for @JSON fields with default values being optional.

This test ensures that fields annotated with @json and having a @default value are correctly treated as optional in the generated Zod schemas. This is important for consistency with Prisma's behavior where fields with defaults don't need to be specified in create operations.

tests/regression/tests/issue-1964.test.ts (2)

1-59: Added regression test for nested deletes with compound unique constraints.

This test validates that updating an Author entity with a compound unique identifier (orgId and name) correctly handles nested deletes of related Post entities. This is important for ensuring the system properly manages relationships when entities are identified by composite keys.


61-127: Added regression test for multi-level nested deletes.

This test ensures that the system correctly handles deleting a deeply nested entity (an Address related to a Profile related to a User). The test confirms that after the update operation, the count of Address entities is zero, validating that the cascading delete through multiple levels of nesting works as expected.

tests/regression/tests/issue-1994.test.ts (1)

1-111: Well-structured regression test for issue #1994.

This test file effectively validates the relationship between polymorphic models using delegation. The schema defines a hierarchy with OrganizationRole as the base model, and SystemDefinedRole/CustomOrganizationRole as extension models, plus many-to-many relationships with privileges.

The test confirms that creating a SystemDefinedRole with associated privileges works correctly, which helps prevent regression of the issue.

tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts (1)

594-645: Improved test coverage for nested updateMany operations.

The changes enhance test coverage by:

  1. Creating two users with different test data
  2. Testing updateMany with a filter condition
  3. Testing updateMany without a filter condition
  4. Verifying that updates are correctly scoped to the targeted user

This provides more comprehensive validation of the delegate enhancement behavior with nested updates.

tests/regression/tests/issue-1984.test.ts (2)

1-29: Good policy validation test for contextual access control.

This test validates that the policy system correctly enforces access control based on:

  1. Containing the model name in auth context (contains(auth().access, currentModel()))
  2. Containing the operation name in auth context (contains(auth().access, currentOperation()))

The test thoroughly checks both positive and negative scenarios with different user access levels.


31-56: Comprehensive validation for function usage constraints.

These tests ensure that the schema validation properly rejects using the currentModel() function in validation contexts, both in model-level validation rules (@@validate) and in field-level validation annotations (@contains).

This helps prevent misuse of context-specific functions in inappropriate locations.

packages/schema/src/plugins/zod/transformer.ts (1)

288-301: Streamlined schema field generation logic.

The code has been restructured to handle alternatives and optional fields more cleanly:

  1. For single alternatives, it directly assigns the value rather than using join operations
  2. For multiple alternatives, it uses either smartUnion or standard union semantics as appropriate
  3. Optionality is now applied consistently after alternative handling rather than in multiple places

This change simplifies the code flow and makes the logic more maintainable.

packages/runtime/src/enhancements/node/delegate.ts (5)

905-905: Improved null/undefined handling for where clause.

This change ensures that an empty object is used as a fallback when args.where is undefined, preventing potential errors when building queries with undefined where clauses.


962-962: Updated buildReversedQuery call with database context.

The method call now includes the database connection (db) parameter, which is needed for the enhanced query building logic that handles foreign key resolution.


1025-1025: Updated buildReversedQuery call with database context.

The delete operation now correctly passes the database connection, ensuring consistent behavior with other operations that rely on the query building logic.


1033-1033: Updated buildReversedQuery call with database context.

The deleteMany operation now correctly passes the database connection, ensuring proper resolution of relations when building queries.


1096-1096: Improved null/undefined handling for where clause.

Similar to other changes, this ensures that an empty object is used as a fallback when where is undefined in the doDeleteMany method.

tests/integration/tests/enhancements/with-policy/unique-as-id.test.ts (2)

175-233: Well-structured test for to-many nested updates.

This test thoroughly validates that nested updates in a one-to-many relationship correctly target only the intended records, without affecting unrelated data. It tests both update and delete operations.

Key aspects tested:

  • Creating models with proper relations
  • Updating nested records using compound unique constraints
  • Verifying updates affect only targeted records
  • Testing deletion of nested records
  • Confirming non-related records remain unaffected

The test provides good coverage for the recent updates to the query building logic.


235-295: Comprehensive test for to-one nested updates.

This test validates that nested updates in a one-to-one relationship work correctly, covering similar scenarios as the to-many test but for the one-to-one case. The test ensures that:

  • Records are correctly created with relations
  • Updates to nested records only affect the targeted relations
  • Deleting nested records works as expected
  • Non-related records remain unaffected

The combination of this test with the to-many test provides good coverage of the nested update functionality.

packages/schema/src/plugins/enhancer/enhance/index.ts (5)

73-74: Added reversedShortNameMap for improved name resolution.

This new map provides a way to look up full names from their shortened versions, which is essential for handling model names that might be truncated in the Prisma schema.


337-340: Populate reversedShortNameMap from generation result.

Effectively initializes the map by reversing the direction of entries in generateResult.shortNameMap, ensuring that shortened names can be resolved back to their original forms.


782-794: Added resolveName method for consistent name resolution.

This helper method resolves potentially shortened model names back to their original forms, handling cases with or without the delegate auxiliary prefix. This increases code consistency and reduces the chance of errors when working with model names.


401-401: Updated model name extraction to use resolveName.

These changes ensure that model names extracted from regex matches are consistently resolved to their full names, improving the robustness of the code when handling shortened names.

Also applies to: 682-685, 802-802, 858-858


735-738: Enhanced name resolution for compound names.

This section properly handles the complex case of resolving compound names that may contain multiple parts separated by underscores, providing a more robust resolution strategy.

packages/runtime/src/enhancements/node/query-utils.ts (4)

13-14: Updated imports for logging functionality.

Now importing formatObject from edge and adding the Logger import, which is needed for the enhanced logging capabilities added to the class.


19-23: Added logger property and initialization.

This addition enables the class to perform logging through Prisma's logging mechanisms, which is useful for debugging and monitoring query execution. The logger is properly initialized in the constructor.


69-74: Improved buildReversedQuery method signature.

The method now:

  1. Takes a db parameter of type CrudContract for database operations
  2. Uses a more meaningful parameter name uncheckedOperation instead of unsafeOperation

These changes improve clarity and provide necessary context for the enhanced foreign key handling.


125-145: Enhanced foreign key handling in buildReversedQuery.

This significant improvement properly handles cases where the parent condition doesn't contain all required ID fields:

  1. Initializes parentPk with visitWhere
  2. Checks if any required foreign keys are missing or undefined
  3. If keys are missing, loads the entity from the database using findUniqueOrThrow
  4. Uses the resolved primary keys to set foreign key values

This approach is more robust and prevents errors when building queries with incomplete foreign key information.

packages/schema/src/language-server/validator/function-invocation-validator.ts (6)

14-14: Well-organized imports.

Both new imports are appropriately placed in alphabetical order within their respective import blocks, maintaining code consistency.

Also applies to: 25-25


75-75: Good refactoring for expression context determination.

Extracting this logic into a separate method improves code organization and readability.


80-89: Enhanced validation with improved error messages.

The updated condition now checks more robustly for valid contexts and provides a more informative error message that includes the current context when available.


127-128: Appropriate enhancement to validation rules.

This addition correctly allows static function calls that are runtime constants to be used as second arguments in function calls, delegating to the new isStaticFunctionCall method.


156-168: Well-structured expression context determination.

The new getExpressionContext method centralizes the logic for determining expression contexts, making the code more maintainable. It correctly handles validation attributes and uses pattern matching for clear, readable code organization.


170-172: Concise and focused utility method.

This method encapsulates the check for static function calls in a descriptive way, improving code readability and maintainability.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

@ymc9 ymc9 merged commit 8a62f63 into main Mar 24, 2025
13 checks passed
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.

3 participants