-
-
Notifications
You must be signed in to change notification settings - Fork 113
merge dev to main (v1.11.1) #1164
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
Conversation
WalkthroughWalkthroughThis update introduces a variety of improvements and bug fixes across the project. Notably, it enhances the JetBrains IDE plugin with new features and fixes, updates the handling of path normalization in several plugins through the use of a Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
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)
- README.md (1 hunks)
- packages/ide/jetbrains/CHANGELOG.md (1 hunks)
- packages/ide/jetbrains/build.gradle.kts (1 hunks)
- packages/plugins/openapi/tests/openapi-restful.test.ts (8 hunks)
- packages/plugins/openapi/tests/openapi-rpc.test.ts (12 hunks)
- packages/plugins/swr/tests/swr.test.ts (3 hunks)
- packages/plugins/tanstack-query/tests/plugin.test.ts (7 hunks)
- packages/plugins/trpc/tests/trpc.test.ts (11 hunks)
- packages/runtime/src/enhancements/policy/handler.ts (14 hunks)
- packages/runtime/src/enhancements/policy/policy-utils.ts (3 hunks)
- packages/runtime/src/enhancements/types.ts (1 hunks)
- packages/runtime/src/enhancements/utils.ts (2 hunks)
- packages/testtools/src/schema.ts (3 hunks)
- tests/integration/tests/enhancements/with-policy/options.test.ts (3 hunks)
- tests/integration/tests/regression/issue-1162.test.ts (1 hunks)
Files not reviewed due to errors (7)
- (no review received)
- (no review received)
- (no review received)
- (no review received)
- (no review received)
- (no review received)
- (no review received)
Additional comments: 39
packages/ide/jetbrains/CHANGELOG.md (2)
- 7-7: LGTM! The addition under the "Unreleased" section is clear and follows the changelog's format.
- 23-23: LGTM! The addition under version 1.7.0 is clear and follows the changelog's format.
README.md (1)
- 238-239: The addition of Fabian Jocks to the acknowledgments section is correctly formatted and consistent with the rest of the section.
packages/plugins/openapi/tests/openapi-restful.test.ts (2)
- 7-7: The import of
normalizePath
from@zenstackhq/testtools
is correctly added.- 19-19: The usage of
normalizePath
for theprovider
field in theplugin openapi
block is correctly implemented across various test cases. This ensures consistent path handling.Also applies to: 117-117, 154-154, 201-201, 233-233, 254-254, 287-287
packages/testtools/src/schema.ts (2)
- 57-57: Exporting the
normalizePath
function is a good practice, allowing for consistent path handling across different OS environments.- 178-178: The introduction of the
normalizedProjectRoot
variable to replace$projectRoot
placeholders in the schema file ensures consistent path normalization. This is a good improvement for handling paths in a cross-platform manner.packages/plugins/trpc/tests/trpc.test.ts (11)
- 3-3: The import of
normalizePath
alongsideloadSchema
is a good practice for ensuring consistent path handling across different operating systems and environments.- 22-22: Using
normalizePath
for the provider path in the tRPC plugin configuration ensures that the path is correctly formatted across different environments. This is a crucial improvement for cross-platform compatibility.- 70-70: Consistent application of
normalizePath
for path resolution in the tRPC plugin configuration. This consistency is key for maintainability and readability of the test suite.- 113-113: The use of
normalizePath
in a non-standard ZModel location test case demonstrates the flexibility and utility of the function in handling various path scenarios within the project.- 144-144: Applying
normalizePath
in the context of specifying model actions to generate demonstrates a good practice of ensuring path consistency even in more complex configurations.- 174-174: Continued use of
normalizePath
in various configurations within the test suite reinforces the importance of consistent path handling. This consistency aids in the reliability of the tests across environments.- 223-223: The application of
normalizePath
in generating client helpers for react-query within the tRPC plugin tests shows the adaptability of the function for different use cases, further enhancing the test suite's robustness.- 248-248: Utilizing
normalizePath
for client helper generation in a Next.js context within the tRPC plugin tests. This demonstrates the function's broad applicability and its role in ensuring consistent path handling across various testing scenarios.- 268-268: The use of
normalizePath
in tests involving mixed casing in model names. This highlights the function's effectiveness in handling paths in diverse and potentially challenging naming conventions.- 307-307: Employing
normalizePath
in the context of generating routers for selected models and actions. This use case underscores the function's importance in maintaining path consistency across different parts of the test suite.- 378-378: The consistent use of
normalizePath
across various test scenarios, including when the Zod plugin is declared, showcases the function's versatility and its critical role in ensuring path consistency throughout the test suite.packages/plugins/openapi/tests/openapi-rpc.test.ts (12)
- 7-7: The import of
normalizePath
alongsideloadZModelAndDmmf
is a good practice for ensuring consistent path handling across different operating systems and environments.- 19-19: Using
normalizePath
for the provider path in the OpenAPI plugin configuration ensures that the path is correctly formatted across different environments. This is a crucial improvement for cross-platform compatibility.- 130-130: Consistent application of
normalizePath
for path resolution in the OpenAPI plugin configuration. This consistency is key for maintainability and readability of the test suite.- 167-167: The use of
normalizePath
in configuring security schemes within the OpenAPI plugin tests demonstrates the flexibility and utility of the function in handling various path scenarios within the project.- 201-201: Applying
normalizePath
in the context of specifying invalid security schemes. While the focus here is on testing error handling, the consistent use ofnormalizePath
reinforces the importance of path consistency across all test scenarios.- 222-222: Utilizing
normalizePath
in tests involving security model level overrides. This highlights the function's effectiveness in handling paths in diverse testing scenarios, including those involving security configurations.- 250-250: The application of
normalizePath
in security operation level overrides within the OpenAPI plugin tests. This demonstrates the function's broad applicability and its role in ensuring consistent path handling across various testing scenarios.- 283-283: Employing
normalizePath
in the context of inferred security within the OpenAPI plugin tests. This use case underscores the function's importance in maintaining path consistency across different parts of the test suite.- 309-309: The consistent use of
normalizePath
across various test scenarios, including when testing OpenAPI v3.1.0 fields. This showcases the function's versatility and its critical role in ensuring path consistency throughout the test suite.- 333-333: Utilizing
normalizePath
in tests involving ignored models used as relations. This highlights the function's effectiveness in handling paths in complex model relationships and testing scenarios.- 365-365: The application of
normalizePath
in field type coverage tests within the OpenAPI plugin. This demonstrates the function's broad applicability and its role in ensuring consistent path handling across various testing scenarios, including those involving diverse field types.- 411-411: Employing
normalizePath
in the context of full-text search feature testing within the OpenAPI plugin. This use case underscores the function's importance in maintaining path consistency across different parts of the test suite, including those involving advanced database features.packages/runtime/src/enhancements/policy/policy-utils.ts (5)
- 52-52: The addition of the
options
parameter of typeEnhancementOptions | undefined
to the constructor of thePolicyUtil
class is a significant change. It's important to ensure that all usages ofPolicyUtil
throughout the codebase have been updated to pass this new parameter where necessary.Verification successful
Given the limitations of the initial script and the importance of ensuring that all instances of
PolicyUtil
instantiation have been correctly updated to include the newoptions
parameter, a more comprehensive verification is necessary. Let's adjust the verification strategy to search for instances ofPolicyUtil
instantiation that include the newoptions
parameter, which would imply searching for instances with seven parameters instead.
The verification process has identified at least one instance in the codebase (
./packages/runtime/src/enhancements/policy/handler.ts
) where thePolicyUtil
constructor is correctly instantiated with the newoptions
parameter, indicating that the necessary updates to accommodate this change have been made in this part of the codebase. Without evidence of incorrect usage or missing updates elsewhere, it's reasonable to conclude that the addition of theoptions
parameter to thePolicyUtil
constructor has been successfully integrated where identified.* 1103-1103: The `options` parameter is correctly utilized in the `deniedByPolicy` method to pass enhancement options to the error handling utilities. This is a good use of the newly added parameter to customize error responses based on the provided options. * 1110-1110: The `options` parameter is also correctly utilized in the `notFound` method. This consistency in using the `options` parameter across different error handling methods enhances the flexibility and configurability of error responses. * 1117-1117: The `options` parameter is used in the `validationError` method. This is consistent with its usage in other error handling methods, ensuring that enhancement options are considered when generating validation errors. * 1121-1121: The `options` parameter is utilized in the `unknownError` method. This consistent application of the `options` parameter across all error handling methods in the `PolicyUtil` class is commendable, as it allows for enhanced error customization based on the provided options.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for usages of PolicyUtil constructor without the new options parameter. ast-grep --lang typescript --pattern $'new PolicyUtil($_, $_, $_, $_, $_, $_)'Length of output: 79
Script:
#!/bin/bash # Search for usages of PolicyUtil constructor with the new options parameter, indicating correct usage. ast-grep --lang typescript --pattern $'new PolicyUtil($_, $_, $_, $_, $_, $_, $_)'Length of output: 832
packages/runtime/src/enhancements/policy/handler.ts (4)
- 7-7: The import of
WithPolicyOptions
is correctly added to support enhanced policy options in error messages and method calls. This aligns with the PR objectives to improve error handling and policy options in the runtime package.- 61-61: The addition of
this.options
as a parameter to thePolicyUtil
constructor is a good practice, ensuring that policy options are correctly passed and utilized within utility methods. This change enhances the flexibility and configurability of policy enforcement.- 81-84: The consistent use of
prismaClientValidationError
across various methods to throw errors when required arguments are missing is a good practice. It ensures that the error messages are standardized and informative, aiding in debugging and error handling. However, ensure that the error messages are clear and specific to the context of each method for better user understanding.Also applies to: 91-94, 224-227, 480-483, 600-606, 1078-1081, 1137-1146, 1190-1193, 1246-1246, 1262-1262, 1306-1306
- 738-741: The logic to check for duplicate unique constraints before proceeding with
createMany
operations is crucial for data integrity and avoiding unnecessary database errors. This preemptive check enhances the robustness of the create operations. However, ensure that the performance impact of these checks is minimal, especially in scenarios with large datasets.
### Added | ||
- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`. | ||
|
||
- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider changing the preposition "to" to "for" for better clarity in describing the support added.
- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.
+ Added support for complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
- Added support to complex usage of `@@index` attribute like `@@index([content(ops: raw("gin_trgm_ops"))], type: Gin)`. |
Summary by CodeRabbit
@@index
attribute usage and auto-completion inside attributes.normalizePath
function for consistent path handling across various test files.PrismaClient
output path specification.