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.4.0) #1635

Merged
merged 16 commits into from
Aug 5, 2024
Merged

merge dev to main (v2.4.0) #1635

merged 16 commits into from
Aug 5, 2024

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Aug 5, 2024

No description provided.

ymc9 and others added 16 commits July 19, 2024 23:07
Copy link
Contributor

coderabbitai bot commented Aug 5, 2024

Walkthrough

Walkthrough

The recent changes enhance the project's overall functionality and maintainability by introducing new configurations, updating existing versions, and refining code structures across multiple files. Key updates include the addition of a shortNameMap for handling mappings in various components, improvements in error handling, and modifications to the schema generation logic. These adjustments aim to improve performance, simplify maintenance, and ensure better integration with the Prisma framework.

Changes

File & Path Change Summary
.npmrc Added node-linker=hoisted for improved package management.
packages/ide/jetbrains/build.gradle.kts Updated version from 2.3.3 to 2.4.0.
packages/misc/redwood/src/commands/setup.ts Introduced path normalization and enhanced version handling for Redwood.
packages/plugins/trpc/src/project.ts Added skipLibCheck to TypeScript compiler options for faster builds.
packages/runtime/jest.config.ts Created new Jest config file referencing parent configuration.
packages/runtime/res/enhance.d.ts Added export of PrismaClient type for better integration with Prisma ORM.
packages/runtime/src/cross/model-meta.ts Introduced optional shortNameMap for model metadata.
packages/runtime/src/enhancements/default-auth.ts Improved error handling by specifying custom error messages.
packages/runtime/src/enhancements/delegate.ts Enhanced auxiliary relation name generation based on a new mapping logic.
packages/runtime/src/enhancements/policy/policy-utils.ts Expanded logic for evaluating access policies with new methods.
packages/runtime/tests/policy/reduction.test.ts Added unit tests for the reduce function within PolicyUtil.
packages/schema/README.md Rephrased descriptions for clarity and emphasis on key features.
packages/schema/src/cli/plugin-runner.ts Updated runPlugin method to handle shortNameMap for plugins.
packages/schema/src/plugins/enhancer/enhance/index.ts Enhanced handling of Prisma models and refined regex patterns for input validation.
packages/schema/src/plugins/prisma/index.ts Expanded return values in run function to include shortNameMap.
packages/schema/tests/generator/expression-writer.test.ts Updated test for Project instantiation to include skipLibCheck.
tests/regression/tests/issue-1610.test.ts Introduced tests for various schema loading scenarios in Prisma.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant System
    participant Database

    User->>System: Request to create a user
    System->>Database: Validate user data
    Database-->>System: Return validation result
    alt Validation successful
        System->>Database: Create user record
        Database-->>System: Confirm user created
        System-->>User: Respond with success
    else Validation failed
        System-->>User: Respond with error
    end
Loading

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

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

Outside diff range, codebase verification and nitpick comments (3)
tests/regression/tests/issue-1596.test.ts (1)

27-30: Consider restructuring the test to avoid the ESLint directive.

The ESLint directive // eslint-disable-next-line jest/no-conditional-expect can be avoided by restructuring the test to use await expect(...).rejects.toThrow(...).

-        try {
-            await db.post.create({ data: { title: 'Post1' } });
-        } catch (e) {
-            // eslint-disable-next-line jest/no-conditional-expect
-            expect(isPrismaClientValidationError(e)).toBe(true);
-            return;
-        }
-        throw new Error('Expected error');
+        await expect(db.post.create({ data: { title: 'Post1' } }))
+            .rejects
+            .toThrow(expect.objectContaining({
+                name: 'PrismaClientValidationError'
+            }));
packages/testtools/src/schema.ts (1)

240-240: Verify the impact of removed parameters.

The parameters policy, modelMeta, and zodSchemas are still being used in various parts of the codebase, including tests and other packages. Their removal from packages/testtools/src/schema.ts might affect the logic in those places.

  • packages/testtools/src/schema.ts: Lines where policy, modelMeta, and zodSchemas were previously used.

Please review these locations to ensure that the removal of these parameters does not affect the subsequent logic.

Analysis chain

Verify the impact of removed parameters.

The removal of policy, modelMeta, and zodSchemas from the object destructuring suggests a simplification of the logic. Ensure that these parameters are no longer necessary for the subsequent logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the removed parameters `policy`, `modelMeta`, and `zodSchemas`.

# Test: Search for the usage of `policy`, `modelMeta`, and `zodSchemas` in the codebase. Expect: No longer necessary for the logic.
rg --type ts 'policy|modelMeta|zodSchemas'

Length of output: 91911

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

1544-1544: Use descriptive variable names.

The variable values could be more descriptive to indicate its purpose, such as coercedValues.

- return values.length > 1 ? { in: values } : { equals: values[0] };
+ return coercedValues.length > 1 ? { in: coercedValues } : { equals: coercedValues[0] };
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bf2acfd and ca40e00.

Files ignored due to path filters (14)
  • 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
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !**/*.yaml
Files selected for processing (38)
  • .npmrc (1 hunks)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/misc/redwood/src/commands/setup.ts (4 hunks)
  • packages/plugins/trpc/src/project.ts (1 hunks)
  • packages/runtime/jest.config.ts (1 hunks)
  • packages/runtime/res/enhance.d.ts (1 hunks)
  • packages/runtime/src/cross/model-meta.ts (1 hunks)
  • packages/runtime/src/enhancements/default-auth.ts (2 hunks)
  • packages/runtime/src/enhancements/delegate.ts (1 hunks)
  • packages/runtime/src/enhancements/policy/policy-utils.ts (5 hunks)
  • packages/runtime/tests/policy/reduction.test.ts (1 hunks)
  • packages/schema/README.md (1 hunks)
  • packages/schema/src/cli/plugin-runner.ts (6 hunks)
  • packages/schema/src/plugins/enhancer/enhance/index.ts (8 hunks)
  • packages/schema/src/plugins/enhancer/index.ts (1 hunks)
  • packages/schema/src/plugins/enhancer/model-meta/index.ts (1 hunks)
  • packages/schema/src/plugins/prisma/index.ts (3 hunks)
  • packages/schema/src/plugins/prisma/schema-generator.ts (9 hunks)
  • packages/schema/src/plugins/zod/generator.ts (7 hunks)
  • packages/schema/src/plugins/zod/transformer.ts (2 hunks)
  • packages/schema/src/res/stdlib.zmodel (1 hunks)
  • packages/schema/tests/generator/expression-writer.test.ts (1 hunks)
  • packages/sdk/src/model-meta-generator.ts (4 hunks)
  • packages/sdk/src/types.ts (2 hunks)
  • packages/server/src/api/rest/index.ts (1 hunks)
  • packages/server/tests/api/rest.test.ts (1 hunks)
  • packages/testtools/src/schema.ts (2 hunks)
  • tests/integration/tests/enhancements/with-delegate/enhanced-client.test.ts (1 hunks)
  • tests/integration/tests/enhancements/with-delegate/plugin-interaction.test.ts (1 hunks)
  • tests/integration/tests/enhancements/with-delegate/utils.ts (1 hunks)
  • tests/integration/tests/enhancements/with-policy/field-validation.test.ts (2 hunks)
  • tests/regression/tests/issue-1466.test.ts (2 hunks)
  • tests/regression/tests/issue-1551.test.ts (1 hunks)
  • tests/regression/tests/issue-1562.test.ts (1 hunks)
  • tests/regression/tests/issue-1563.test.ts (1 hunks)
  • tests/regression/tests/issue-1596.test.ts (1 hunks)
  • tests/regression/tests/issue-1610.test.ts (1 hunks)
  • tests/regression/tests/issue-1627.test.ts (1 hunks)
Files skipped from review due to trivial changes (3)
  • packages/ide/jetbrains/build.gradle.kts
  • packages/runtime/jest.config.ts
  • tests/regression/tests/issue-1466.test.ts
Additional comments not posted (62)
.npmrc (1)

3-3: New configuration added: node-linker=hoisted.

The addition of node-linker=hoisted specifies the linking strategy for Node.js modules, potentially improving compatibility and reducing issues related to module resolution.

packages/runtime/res/enhance.d.ts (1)

1-1: New export added: type PrismaClient.

The addition of type PrismaClient enhances the module's interface, facilitating better type-checking and integration with Prisma ORM.

packages/plugins/trpc/src/project.ts (1)

9-9: New property added: skipLibCheck.

The addition of skipLibCheck: true improves compilation speed and reduces errors related to type definitions in third-party libraries.

packages/schema/src/plugins/enhancer/model-meta/index.ts (1)

16-16: Verify the usage of the new parameter shortNameMap.

Ensure that the shortNameMap parameter is correctly passed and utilized within the generateModelMeta function.

Verification successful

The shortNameMap parameter is correctly utilized within the writeShortNameMap function.

  • The writeShortNameMap function checks for the presence of shortNameMap in the options and correctly writes its entries.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new parameter `shortNameMap` in the `generateModelMeta` function.

# Test: Search for the function implementation. Expect: Correct handling of the `shortNameMap` parameter.
rg --type ts -A 10 $'function generateModelMeta'

Length of output: 884


Script:

#!/bin/bash
# Description: Verify the implementation of the `writeShortNameMap` function to ensure it handles the `shortNameMap` parameter correctly.

# Search for the implementation of the `writeShortNameMap` function.
rg --type ts 'function writeShortNameMap'

Length of output: 174


Script:

#!/bin/bash
# Description: Extract the full implementation of the `writeShortNameMap` function to verify the usage of the `shortNameMap` parameter.

# Extract the full implementation of the `writeShortNameMap` function.
rg --type ts -A 20 'function writeShortNameMap' packages/sdk/src/model-meta-generator.ts

Length of output: 491

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

1-25: LGTM! Ensure the test case execution.

The test case correctly loads the schema and verifies the regression scenario for issue 1551.

However, ensure that the test case is executed and passes successfully.

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

1-29: LGTM! Ensure the test case execution.

The test case correctly loads the schema and verifies the regression scenario for issue 1563.

However, ensure that the test case is executed and passes successfully.

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

1-44: LGTM!

The test case is well-structured and effectively validates the policy rejection.

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

1-49: LGTM!

The test case is well-structured and effectively validates the handling of gym memberships.

packages/schema/README.md (1)

3-3: Improved clarity and appeal.

The rephrased description accurately reflects the functionality and value proposition of the toolkit.

tests/regression/tests/issue-1610.test.ts (3)

3-18: Test case for regular Prisma client looks good.

The schema is correctly defined and the test case is properly implemented.


21-36: Test case for logical Prisma client looks good.

The schema is correctly defined and the test case is properly implemented.


39-54: Test case for no custom output looks good.

The schema is correctly defined and the test case is properly implemented.

tests/integration/tests/enhancements/with-delegate/utils.ts (2)

48-50: Model VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongModelNameA looks good.

The model is correctly defined and integrated.


52-54: Model VeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongModelNameB looks good.

The model is correctly defined and integrated.

packages/schema/src/plugins/enhancer/index.ts (2)

27-29: Enhanced flexibility in output path specification.

The updated conditional check for options.output or globalOptions?.output enhances the flexibility in specifying the output path.


31-31: Verify the correctness of path resolution.

Ensure that the path resolution using outDir is correct and does not introduce any issues.

Verification successful

Path resolution using outDir is correctly implemented.

The resolvePath function ensures that the outDir is correctly resolved relative to the directory of options.schemaPath if it is not an absolute path.

  • resolvePath implementation in packages/sdk/src/utils.ts correctly handles both absolute and relative paths.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of path resolution using `outDir`.

# Test: Search for the usage of `outDir` and ensure it is correctly resolved.
rg --type python -A 5 $'outDir'

Length of output: 61


Script:

#!/bin/bash
# Description: Verify the correctness of path resolution using `outDir` in TypeScript files.

# Test: Search for the usage of `outDir` in TypeScript files and ensure it is correctly resolved.
rg --type ts -A 5 'outDir'

Length of output: 21561


Script:

#!/bin/bash
# Description: Verify the implementation of `resolvePath` used for resolving `outDir`.

# Test: Search for the definition and implementation of `resolvePath`.
rg 'function resolvePath' -A 10

Length of output: 724

packages/sdk/src/types.ts (2)

33-38: Enhanced functionality with shortNameMap.

The addition of the optional shortNameMap property enhances the functionality of PluginOptions by providing a mechanism for name abbreviation.


82-87: Enhanced functionality with shortNameMap.

The addition of the optional shortNameMap property enhances the functionality of PluginResult by providing a mechanism for name abbreviation.

packages/runtime/tests/policy/reduction.test.ts (1)

1-67: Comprehensive test cases for query reduction.

The addition of comprehensive test cases for the reduce function ensures various query reduction scenarios are handled correctly.

packages/runtime/src/cross/model-meta.ts (1)

164-168: LGTM! The addition of shortNameMap is straightforward.

The new property shortNameMap is an optional Record<string, string> which enhances the metadata capabilities of the model.

packages/schema/src/plugins/prisma/index.ts (2)

1-1: LGTM! Explicit import of PluginOptions improves type safety.

The explicit import and utilization of PluginOptions ensures that the options passed to the PrismaSchemaGenerator are correctly typed.


78-78: LGTM! The expansion of the return value enhances functionality.

The inclusion of shortNameMap in the returned object from the run function enhances the usability or functionality of the generated Prisma schema.

tests/integration/tests/enhancements/with-delegate/plugin-interaction.test.ts (1)

59-147: LGTM! The new test case enhances schema validation.

The new test case for validating various Zod schemas related to Asset, Video, and their respective creation and update operations enhances the robustness of the schema validation process.

packages/runtime/src/enhancements/default-auth.ts (1)

153-157: LGTM! But verify the usage of prismaClientValidationError.

The change to throw prismaClientValidationError instead of a generic Error is approved.

However, ensure that prismaClientValidationError is used correctly and consistently throughout the codebase.

Verification successful

LGTM!

The change to throw prismaClientValidationError instead of a generic Error is approved. The usage of prismaClientValidationError is consistent and correct throughout the codebase.

  • Verified in the following files:
    • packages/runtime/src/enhancements/default-auth.ts
    • packages/runtime/src/enhancements/query-utils.ts
    • packages/runtime/src/enhancements/delegate.ts
    • packages/runtime/src/enhancements/policy/handler.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `prismaClientValidationError` in the codebase.

# Test: Search for the usage of `prismaClientValidationError`. Expect: Consistent usage across the codebase.
rg --type ts 'prismaClientValidationError'

Length of output: 7903

packages/misc/redwood/src/commands/setup.ts (2)

51-52: LGTM!

The use of normalizePath to ensure POSIX path separators in package.json improves cross-platform compatibility.


153-157: LGTM!

The logic to determine the correct module to import based on the installed version of Redwood enhances flexibility and compatibility.

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

240-240: LGTM!

The modification to include --skip-generate in the pushDb command can improve performance by preventing the generation of client code during the push.

packages/schema/src/cli/plugin-runner.ts (3)

148-151: Ensure shortNameMap is updated correctly.

The code correctly updates shortNameMap if it is returned by the plugin.


321-321: Update runPlugin method signature.

The method signature now includes shortNameMap, which is necessary for the plugin execution.


336-340: Include shortNameMap in plugin options.

The shortNameMap is correctly included in the options passed to the plugin's run function.

packages/sdk/src/model-meta-generator.ts (3)

57-61: Add shortNameMap to ModelMetaGeneratorOptions.

The addition of shortNameMap enhances the flexibility of handling extra fields and relations.


92-92: Call writeShortNameMap in generateModelMetadata.

The function correctly integrates the call to writeShortNameMap to handle the shortNameMap option.


540-550: Add writeShortNameMap function.

The function correctly handles the shortNameMap option, formatting and writing the mappings if they exist.

packages/schema/src/plugins/zod/generator.ts (4)

372-378: Handle discriminator fields in generateModelSchema.

The function correctly integrates the omitDiscriminators variable to exclude discriminator fields from mutation schemas.


440-440: Use omitDiscriminators in prismaCreateSchema.

The prismaCreateSchema correctly incorporates the omitDiscriminators variable to exclude discriminator fields.


456-456: Filter out discriminator fields in prismaUpdateSchema.

The prismaUpdateSchema correctly filters out discriminator fields, ensuring they are not included in updates.


481-481: Use omitDiscriminators in createSchema.

The createSchema correctly incorporates the omitDiscriminators variable to exclude discriminator fields.

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

10-10: Ensure isDiscriminatorField is used correctly.

Verify that isDiscriminatorField is used appropriately in the code to handle discriminator fields.


130-132: LGTM!

The addition of PrismaClient to the exports is correct and necessary.


156-156: LGTM!

The addition of PrismaClient to the exports is correct and necessary.


489-494: LGTM!

The use of the class property for the regex pattern improves maintainability.


502-502: LGTM!

The addition of the ModelCreateUpdateInputRegex property is correct and improves maintainability.


506-529: LGTM!

The use of the class property ModelCreateUpdateInputRegex improves maintainability.


546-548: LGTM!

The addition of the CreateUpdateWithoutDelegateRelationRegex property is correct and improves maintainability.


Line range hint 549-560:
LGTM!

The use of the class property CreateUpdateWithoutDelegateRelationRegex improves maintainability.

packages/schema/src/res/stdlib.zmodel (1)

405-408: LGTM!

The changes to make the parameters nullable for the attributes related to string types are correct and enhance flexibility.

tests/integration/tests/enhancements/with-policy/field-validation.test.ts (2)

649-651: LGTM!

The changes to the validation logic for the create and update methods are correct and necessary.


952-952: LGTM!

The changes to the validation logic for the update method are correct and necessary.

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

93-93: Ensure the regex pattern is correct.

The regex pattern /(\S+)(Unchecked)?(Create|Update).*Input/ is used to identify create/update input types. Ensure this pattern correctly matches all intended input types.


98-115: Verify the logic for excluding discriminator fields.

The logic to exclude discriminator fields from create/update input schemas looks correct. Ensure that the isDiscriminatorField function properly identifies discriminator fields and that the fields variable is correctly updated.

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

163-163: Ensure the shortNameMap is correctly populated.

The shortNameMap now maps full names to shortened names. Verify that the map is correctly populated and used throughout the codebase.


321-321: Verify the truncate method usage.

The truncate method is used to ensure auxiliary relation names conform to the expected naming conventions. Verify that the method correctly truncates names and handles conflicts.


342-342: Verify the truncate method usage.

The truncate method is used to ensure relation field names conform to the expected naming conventions. Verify that the method correctly truncates names and handles conflicts.

packages/schema/tests/generator/expression-writer.test.ts (1)

1335-1337: Ensure the skipLibCheck option is necessary.

Setting skipLibCheck to true can improve performance and reduce compilation errors related to type definitions in external libraries. Ensure this option is necessary and does not hide important type errors.

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

1043-1046: LGTM! Verify the usage of shortNameMap.

The changes enhance the functionality by allowing for more flexible name resolution. Ensure that the shortNameMap is correctly populated and used throughout the codebase.

Verification successful

Let's re-run the search for shortNameMap without specifying the file type to ensure we capture all relevant occurrences in the codebase.


LGTM!

The shortNameMap is correctly populated and used throughout the codebase, enhancing the functionality by allowing for more flexible name resolution.

  • packages/runtime/src/enhancements/delegate.ts
  • packages/schema/src/cli/plugin-runner.ts
  • packages/schema/src/plugins/prisma/schema-generator.ts
  • packages/sdk/src/types.ts
  • packages/sdk/src/model-meta-generator.ts
  • packages/runtime/src/cross/model-meta.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `shortNameMap` in the codebase.

# Test: Search for the usage of `shortNameMap`. Expect: Relevant occurrences of `shortNameMap`.
rg --type typescript 'shortNameMap'

Length of output: 70


Script:

#!/bin/bash
# Description: Verify the usage of `shortNameMap` in the codebase.

# Test: Search for the usage of `shortNameMap`. Expect: Relevant occurrences of `shortNameMap`.
rg 'shortNameMap'

Length of output: 2438

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

1199-1241: LGTM!

The new test case effectively validates the handling of very long model names in the database, ensuring robustness.

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

111-115: LGTM! The singleKey method correctly handles null and undefined values.

The changes ensure that the method returns false for null and undefined values, improving robustness.


119-144: LGTM! The isTrue method correctly handles null, undefined, and non-plain objects.

The changes ensure that the method returns false for these cases and includes comprehensive checks for various conditions.


147-167: LGTM! The isFalse method correctly handles null, undefined, and non-plain objects.

The changes ensure that the method returns false for these cases and includes comprehensive checks for various conditions.

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

1537-1537: Ensure op is undefined check is necessary.

The check for op being undefined is crucial for the new logic. Ensure that this condition is necessary and correctly handled.


1545-1546: Ensure proper handling of filter and sort errors.

The method should handle errors from the buildFilter and buildSort methods appropriately. Ensure that these errors are correctly propagated and managed.

packages/server/tests/api/rest.test.ts (1)

371-380: Ensure comprehensive test coverage for multi-ID filters.

The test case should cover various scenarios, including edge cases such as empty IDs, invalid IDs, and mixed valid/invalid IDs. Ensure that these cases are tested to verify the robustness of the filter handling.

packages/server/src/api/rest/index.ts Show resolved Hide resolved
packages/schema/src/cli/plugin-runner.ts Show resolved Hide resolved
@ymc9 ymc9 merged commit 6990656 into main Aug 5, 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.

3 participants