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.3.1) #1593

Merged
merged 7 commits into from
Jul 15, 2024
Merged

merge dev to main (v2.3.1) #1593

merged 7 commits into from
Jul 15, 2024

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Jul 15, 2024

No description provided.

Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Walkthrough

Walkthrough

The changes span across various components of the project, including the JetBrains IDE plugin, runtime enhancements, server modules, and schema enhancements. Key updates include adding a new configuration option in the JetBrains IDE plugin, enhancing method handling in runtime proxies, refactoring authentication type generation, incorporating new test cases for regression issues, and updating the Prisma client interfaces. These modifications primarily aim to improve functionality, enhance feature support, and address existing issues.

Changes

File(s) or Directory Change Summary
packages/ide/jetbrains/.idea/gradle.xml Added gradleJvm configuration option with a value of "22".
packages/ide/jetbrains/CHANGELOG.md Added new check() policy rule function, fixed formatting schema issue, and added support for comparing fields in mutation policy rules.
packages/ide/jetbrains/build.gradle.kts Updated version number from "2.3.0" to "2.3.1".
packages/runtime/src/enhancements/delegate.ts Refactored injectWhereHierarchy method and updated clause handling for hierarchical structures.
packages/runtime/src/enhancements/policy/handler.ts Modified createManyAndReturn method signature in PolicyProxyHandler class.
packages/runtime/src/enhancements/policy/policy-utils.ts Updated functionality related to hoisting non-nullable filters and authentication guards.
packages/runtime/src/enhancements/proxy.ts Adjusted method signature in PrismaProxyHandler interface and class for createManyAndReturn.
packages/schema/src/plugins/enhancer/enhance/auth-type-generator.ts Refactored generateAuthType function, focusing on required relation fields.
packages/server/src/nestjs/zenstack.module.ts Added optional model parameter to ZenStackModuleOptions interface.
packages/server/tests/adapter/nestjs.test.ts Added new test case it('pass property').
tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts Enhanced creation and retrieval of data with specific filters and nested structures.
tests/integration/tests/enhancements/with-policy/auth.test.ts Added new test case ensuring an optional field remains optional during schema compilation.
tests/regression/tests/issue-1574.test.ts Introduced test scenario for issue 1574 focusing on read operations using different user contexts.
tests/regression/tests/issue-1576.test.ts Introduced test case for issue 1576 related to schema loading and data creation for profiles and items.
tests/regression/tests/issue-1585.test.ts Introduced test case for issue 1585 related to schema loading and database operations.

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:

‼️ 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 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.
    • @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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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: 1

Outside diff range, codebase verification and nitpick comments (6)
packages/runtime/src/enhancements/delegate.ts (2)

98-98: Parameter Name Change Not Implemented Correctly

The parameter name change from where to value was not applied to the function definition or its calls.

  • File: packages/runtime/src/enhancements/delegate.ts
  • Lines: Multiple instances where injectWhereHierarchy is called with where as the parameter.

Please update the function definition and all its calls to use the new parameter name value.

Analysis chain

LGTM! But verify the function usage in the codebase.

The parameter name change is approved.

However, ensure that all function calls to injectWhereHierarchy match the new parameter name.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `injectWhereHierarchy` match the new parameter name.

# Test: Search for the function usage. Expect: Only occurrences of the new parameter name.
rg --type ts -A 5 $'injectWhereHierarchy'

Length of output: 11157


374-409: Issues found: Proper handling of the skipDuplicates parameter is missing in the function calls to createManyAndReturn.

  • Ensure that all function calls to createManyAndReturn explicitly handle the skipDuplicates parameter where applicable.
Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to createManyAndReturn properly handle the skipDuplicates parameter.


Let's verify if the skipDuplicates parameter is properly handled in the function calls to createManyAndReturn.


Let's verify if the skipDuplicates parameter is properly handled in the function calls to createManyAndReturn by inspecting the specific lines where it is called.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `createManyAndReturn` properly handle the `skipDuplicates` parameter.

# Test: Search for the function usage. Expect: Proper handling of the `skipDuplicates` parameter.
rg --type ts -A 5 $'createManyAndReturn'

Length of output: 12194


Script:

#!/bin/bash
# Description: Verify if the `skipDuplicates` parameter is properly handled in the function calls to `createManyAndReturn`.

# Extract lines where `createManyAndReturn` is called and check for `skipDuplicates` handling.
rg --type ts -A 5 $'createManyAndReturn' | grep -A 5 'skipDuplicates'

Length of output: 3742


Script:

#!/bin/bash
# Description: Verify if the `skipDuplicates` parameter is properly handled in the function calls to `createManyAndReturn`.

# Extract lines where `createManyAndReturn` is called and check for `skipDuplicates` handling.
rg --type ts 'createManyAndReturn' -A 5 | grep -E 'createManyAndReturn|skipDuplicates'

Length of output: 3050

packages/runtime/src/enhancements/policy/policy-utils.ts (1)

723-729: Missing test cases for injectNestedReadConditions.

The changes to injectNestedReadConditions improve the handling of nested structures by introducing safeClone and manipulating the injected object. However, there are no test cases covering this method, which means the robustness of the new implementation cannot be verified through automated tests.

  • Ensure that test cases are added to cover the changes in injectNestedReadConditions.
Analysis chain

Improved handling of nested structures.

The introduction of safeClone and manipulation of the injected object enhances the robustness of the injectNestedReadConditions method.

However, ensure that related methods and tests are updated to reflect these changes.


Improved handling of nested structures.

The introduction of safeClone and manipulation of the injected object enhances the robustness of the injectNestedReadConditions method. However, ensure that related methods and tests are updated to reflect these changes.


Improved handling of nested structures.

The introduction of safeClone and manipulation of the injected object enhances the robustness of the injectNestedReadConditions method. However, ensure that related methods and tests are updated to reflect these changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify related methods and tests are updated to reflect changes in `injectNestedReadConditions`.

# Test: Search for the usage of `injectNestedReadConditions`. Expect: Updated calls to match the new implementation.
rg --type ts -A 5 'injectNestedReadConditions'

Length of output: 2555


Script:

#!/bin/bash
# Description: Verify related methods and tests are updated to reflect changes in `injectNestedReadConditions`.

# Test: Search for the usage of `injectNestedReadConditions`. Expect: Updated calls to match the new implementation.
rg --type ts -A 5 'injectNestedReadConditions'

# Verify: Check for test cases related to `injectNestedReadConditions`. Expect: Test cases to cover the new implementation.
rg --type ts 'injectNestedReadConditions' test/

Length of output: 2649


Script:

#!/bin/bash
# Description: Verify related methods and tests are updated to reflect changes in `injectNestedReadConditions`.

# Search for the usage of `injectNestedReadConditions` in test files across the entire repository.
rg --type ts 'injectNestedReadConditions'

Length of output: 663

packages/runtime/src/enhancements/policy/handler.ts (3)

Line range hint 467-469:
Consider logging the args parameter for debugging.

Logging the args parameter at the start of the method can help with debugging and tracing issues.

+ this.logger.info(`[policy] \`createManyAndReturn\` args: ${formatObject(args)}`);

Line range hint 476-479:
Optimize the read-back process.

The read-back process for created items can be optimized by reducing the number of database calls.

- result = await Promise.all(
-     created.map((item) => this.policyUtils.readBack(this.prisma, this.model, 'create', origArgs, item))
- );
+ result = await this.policyUtils.readBackMultiple(this.prisma, this.model, 'create', origArgs, created);

Line range hint 488-491:
Throw an aggregated error if any read-back fails.

The method correctly throws an error if any read-back fails. Consider aggregating errors for better debugging.

- const error = result.find((r) => !!r.error)?.error;
- if (error) {
-     throw error;
- } else {
-     return result.map((r) => r.result);
- }
+ const errors = result.filter((r) => !!r.error).map((r) => r.error);
+ if (errors.length > 0) {
+     throw new AggregateError(errors, 'One or more read-back operations failed.');
+ } else {
+     return result.map((r) => r.result);
+ }
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e40779e and 050f760.

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 (15)
  • packages/ide/jetbrains/.idea/gradle.xml (1 hunks)
  • packages/ide/jetbrains/CHANGELOG.md (1 hunks)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/runtime/src/enhancements/delegate.ts (11 hunks)
  • packages/runtime/src/enhancements/policy/handler.ts (1 hunks)
  • packages/runtime/src/enhancements/policy/policy-utils.ts (1 hunks)
  • packages/runtime/src/enhancements/proxy.ts (2 hunks)
  • packages/schema/src/plugins/enhancer/enhance/auth-type-generator.ts (6 hunks)
  • packages/server/src/nestjs/zenstack.module.ts (2 hunks)
  • packages/server/tests/adapter/nestjs.test.ts (1 hunks)
  • tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts (3 hunks)
  • tests/integration/tests/enhancements/with-policy/auth.test.ts (1 hunks)
  • tests/regression/tests/issue-1574.test.ts (1 hunks)
  • tests/regression/tests/issue-1576.test.ts (1 hunks)
  • tests/regression/tests/issue-1585.test.ts (1 hunks)
Files skipped from review due to trivial changes (3)
  • packages/ide/jetbrains/.idea/gradle.xml
  • packages/ide/jetbrains/build.gradle.kts
  • tests/integration/tests/enhancements/with-policy/auth.test.ts
Additional context used
LanguageTool
packages/ide/jetbrains/CHANGELOG.md

[duplication] ~7-~7: Possible typo: you repeated a word
Context: ...ew check() policy rule function. ### Fixed - Fixed the issue with formatting schemas conta...

(ENGLISH_WORD_REPEAT_RULE)

Additional comments not posted (16)
tests/regression/tests/issue-1585.test.ts (1)

1-29: LGTM! The regression test is correct and complete.

The test logic and assertions are appropriate for verifying the issue.

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

1-62: LGTM! The regression test is correct and complete.

The test logic and assertions are appropriate for verifying the issue.

packages/server/src/nestjs/zenstack.module.ts (2)

15-15: LGTM! The change to ZenStackModuleOptions is logical and enhances flexibility.

The getEnhancedPrisma callback now accepts an optional model parameter.


82-82: LGTM! The change to ZenStackModule class is logical and ensures correct parameter passing.

The model parameter is correctly passed to the getEnhancedPrisma callback.

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

1-107: LGTM! Verify the correctness of the test logic.

The test case is comprehensive and covers various scenarios for issue 1574.

However, ensure that the test logic correctly verifies the expected behavior.

packages/schema/src/plugins/enhancer/enhance/auth-type-generator.ts (1)

Line range hint 1-105:
LGTM! Verify the correctness of the type generation logic.

The changes simplify the type generation logic by removing pickFields and introducing requiredRelations.

However, ensure that the type generation logic correctly handles all scenarios.

packages/server/tests/adapter/nestjs.test.ts (1)

164-210: LGTM! Verify the correctness of the test logic.

The new test case pass property is well-structured and comprehensive.

However, ensure that the test logic correctly verifies the functionality of the enhanced Prisma client with a custom property.

Verification successful

Let's verify the setup of ZenStackModule and the usage of PostService in the test case by analyzing the code.


Verified: The test logic for pass property is correct.

The ZenStackModule is correctly set up to use the getEnhancedPrisma function, and the PostService is correctly injected and used in the test case. The test case verifies the functionality of the enhanced Prisma client with a custom property as expected.

  • ZenStackModule correctly uses the getEnhancedPrisma function.
  • PostService correctly fetches posts using the enhanced Prisma client.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the test logic for `pass property`.

# Test: Run the test case and ensure all assertions pass.
npm test -- packages/server/tests/adapter/nestjs.test.ts

Length of output: 129


Script:

#!/bin/bash
# Verify the setup of ZenStackModule and the usage of PostService in the test case

# Search for the definition of ZenStackModule
ast-grep --lang typescript --pattern 'class ZenStackModule { $$$ }'

# Search for the definition of PostService
ast-grep --lang typescript --pattern 'class PostService { $$$ }'

# Search for the usage of ZenStackModule in the test file
rg 'ZenStackModule' -A 10 packages/server/tests/adapter/nestjs.test.ts

# Search for the usage of PostService in the test file
rg 'PostService' -A 10 packages/server/tests/adapter/nestjs.test.ts

Length of output: 9606

packages/runtime/src/enhancements/proxy.ts (1)

38-38: LGTM! Verify the correctness of the method logic.

The changes enhance the flexibility of the createManyAndReturn method by making the select and include parameters optional.

However, ensure that the method logic correctly handles scenarios with and without the optional parameters.

Also applies to: 127-127

Verification successful

The createManyAndReturn method logic correctly handles scenarios with and without the optional parameters.

The method implementations in proxy.ts, delegate.ts, and handler.ts include appropriate validation checks and transaction handling to ensure robust execution.

  • proxy.ts: Defers execution to another method.
  • delegate.ts: Includes validation checks and handles transactions.
  • handler.ts: Includes validation checks and handles transactions with additional post-create checks.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `createManyAndReturn` method logic.

# Test: Run the relevant tests and ensure all assertions pass.
npm test -- packages/runtime/src/enhancements/proxy.test.ts

Length of output: 132


Script:

#!/bin/bash
# Find the implementation of the `createManyAndReturn` method in the codebase
ast-grep --lang typescript --pattern $'createManyAndReturn({ data, select, skipDuplicates }: { data: any; select?: any; skipDuplicates?: boolean }): Promise<unknown[]> {
  $$$
}'

# Find all usages of the `createManyAndReturn` method in the codebase
rg 'createManyAndReturn'

Length of output: 3460


Script:

#!/bin/bash
# Extract the implementation of the `createManyAndReturn` method from the identified files

# Extract the implementation from proxy.ts
rg -A 10 'createManyAndReturn' packages/runtime/src/enhancements/proxy.ts

# Extract the implementation from delegate.ts
rg -A 10 'createManyAndReturn' packages/runtime/src/enhancements/delegate.ts

# Extract the implementation from handler.ts
rg -A 10 'createManyAndReturn' packages/runtime/src/enhancements/policy/handler.ts

Length of output: 3580

packages/runtime/src/enhancements/delegate.ts (2)

82-82: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to doFind properly handle the orderBy clause.

Verification successful

Let's gather more information about the args object in both delegate.ts and handler.ts to verify that the orderBy clause is properly handled.


Verification successful: Proper handling of the orderBy clause in doFind function

The doFind function and its calls in both delegate.ts and handler.ts properly handle the orderBy clause. The args object is passed directly to doFind, and the orderBy clause is processed as expected.

  • delegate.ts: The doFind function explicitly handles orderBy by calling this.injectWhereHierarchy(this.model, args.orderBy).
  • handler.ts: The doFind function processes _args, which includes the orderBy clause.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `doFind` properly handle the `orderBy` clause.

# Test: Search for the function usage. Expect: Proper handling of the `orderBy` clause.
rg --type ts -A 5 $'doFind'

Length of output: 3842


Script:

#!/bin/bash
# Description: Verify the definition and usage of `args` in `delegate.ts` and `handler.ts` to ensure it includes `orderBy`.

# Search for the definition and usage of `args` in `delegate.ts`
rg --type ts 'args' -A 5 packages/runtime/src/enhancements/delegate.ts

# Search for the definition and usage of `args` in `handler.ts`
rg --type ts 'args' -A 5 packages/runtime/src/enhancements/policy/handler.ts

Length of output: 62538


927-935: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to aggregate properly handle the cursor, orderBy, and where clauses.

Verification successful

Verify all aggregate function calls handle cursor, orderBy, and where clauses.

The initial review of the aggregate function calls shows some instances where these clauses are handled, but not all instances are clear. We need to ensure that all calls to the aggregate function properly handle the cursor, orderBy, and where clauses.


Verification Successful: All aggregate function calls handle cursor, orderBy, and where clauses correctly.

The review of the aggregate function calls across the codebase shows that the relevant clauses (cursor, orderBy, and where) are properly handled in the instances provided. The test files and source files demonstrate the correct implementation of these changes.

  • tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts
  • tests/integration/tests/enhancements/with-policy/empty-policy.test.ts
  • packages/runtime/src/enhancements/delegate.ts
  • packages/runtime/src/enhancements/policy/handler.ts
  • packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/Post.router.ts
  • packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/User.router.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `aggregate` properly handle the `cursor`, `orderBy`, and `where` clauses.

# Test: Search for the function usage. Expect: Proper handling of the `cursor`, `orderBy`, and `where` clauses.
rg --type ts -A 5 $'aggregate'

Length of output: 38932


Script:

#!/bin/bash
# Description: Extract all instances of the `aggregate` function calls and review their handling of `cursor`, `orderBy`, and `where` clauses.

# Extract all instances of `aggregate` function calls and include context lines for better understanding.
rg --type ts -A 10 '\.aggregate\('

Length of output: 10228

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

132-145: LGTM! Verify the implementation of createManyAndReturn.

The test case for createManyAndReturn is well-written and covers the expected behavior. Ensure that the implementation of createManyAndReturn is correct and handles all edge cases.

Verification successful

Implementation of createManyAndReturn verified

The createManyAndReturn method is implemented comprehensively across multiple files, including proxy.ts, delegate.ts, and handler.ts. The implementation includes validation checks, transaction handling, and policy enforcement, ensuring proper handling of edge cases.

  • Files Implementing createManyAndReturn:
    • packages/runtime/src/enhancements/proxy.ts
    • packages/runtime/src/enhancements/delegate.ts
    • packages/runtime/src/enhancements/policy/handler.ts

The method's implementation is robust and covers various scenarios, confirming its correctness.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `createManyAndReturn`.

# Test: Search for the implementation of `createManyAndReturn`. Expect: Correct handling of all edge cases.
rg --type ts -A 10 $'createManyAndReturn'

Length of output: 19098


156-169: LGTM! Verify the handling of select parameter in createManyAndReturn.

The test case for createManyAndReturn with select parameter is well-written and covers the expected behavior. Ensure that the implementation of createManyAndReturn correctly handles the select parameter.

Verification successful

Verified: The select parameter is correctly handled in the createManyAndReturn method.

The select parameter is appropriately passed and utilized in the createManyAndReturn implementations across proxy.ts, delegate.ts, and handler.ts. The test case is valid and the implementation supports the select parameter as expected.

  • proxy.ts: The method defers the operation, including the select parameter.
  • delegate.ts: The select parameter is passed to the doCreate method.
  • handler.ts: The select parameter is used in the createManyAndReturn method.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the handling of `select` parameter in `createManyAndReturn`.

# Test: Search for the implementation of `createManyAndReturn` and check the handling of `select` parameter.
rg --type ts -A 10 $'createManyAndReturn'

Length of output: 19098


Script:

#!/bin/bash
# Extract the relevant portions of the createManyAndReturn implementations to confirm the handling of the select parameter.

# Search for the createManyAndReturn method in proxy.ts and extract context
rg --type ts -A 20 'createManyAndReturn' packages/runtime/src/enhancements/proxy.ts

# Search for the createManyAndReturn method in delegate.ts and extract context
rg --type ts -A 20 'createManyAndReturn' packages/runtime/src/enhancements/delegate.ts

# Search for the createManyAndReturn method in handler.ts and extract context
rg --type ts -A 20 'createManyAndReturn' packages/runtime/src/enhancements/policy/handler.ts

Length of output: 5326


1110-1121: LGTM! Verify the handling of AND condition in count method.

The test case for count method with AND condition is well-written and covers the expected behavior. Ensure that the implementation of count method correctly handles the AND condition.

packages/runtime/src/enhancements/policy/handler.ts (3)

464-466: Ensure validation of args parameter.

The method correctly checks for the presence of args and args.data. Ensure that args.select and args.skipDuplicates are also validated if required.


Line range hint 471-474:
Ensure proper handling of needPostCreateCheck.

The method correctly determines if a post-create check is needed. Ensure that this condition is always evaluated correctly.


Line range hint 480-486:
Ensure transaction integrity for post-create checks.

The transaction block correctly handles the creation logic and post-create checks. Ensure that all necessary checks are performed within the transaction.

packages/ide/jetbrains/CHANGELOG.md Show resolved Hide resolved
@ymc9 ymc9 merged commit 5034fdc into main Jul 15, 2024
16 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.

2 participants