-
-
Notifications
You must be signed in to change notification settings - Fork 104
merge dev to main (v2.12.2) #2032
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 pull request introduces several changes. A new sponsor entry (“Suhyl”) has been added to the README. The project version in the Gradle build script is incremented from 2.12.1 to 2.12.2. In two schema generator plugins, the filtering logic has been modified to use the Changes
Sequence Diagram(s)sequenceDiagram
participant Interface as Schema Interface
participant Generator as EnhancerGenerator
participant Filter as Filtering Logic (includes check)
Interface->>Generator: Pass properties/methods
Generator->>Filter: Check each field for delegate prefix via includes()
Filter-->>Generator: Return filtered properties/methods
Generator->>Interface: Generate transformed interface
sequenceDiagram
participant Schema as Object Schema Data
participant Generator as ZodSchemaGenerator
participant Filter as Filtering Logic (includes check)
Schema->>Generator: Provide object fields
Generator->>Filter: Filter fields based on delegate prefix using includes()
Filter-->>Generator: Return filtered fields
Generator->>Schema: Generate final object schema
Possibly related PRs
✨ Finishing Touches
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. 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
tests/regression/tests/issue-2028.test.ts (2)
1-116
: Consider adding a database cleanup step.The test creates a PostgreSQL database but doesn't include cleanup logic to remove it after the test completes. While this might be handled elsewhere, it would be good practice to include cleanup to prevent test database accumulation.
3-4
: Add a brief comment explaining issue #2028.It would be helpful to include a short comment explaining what issue #2028 was about (related to delegate auxiliary fields filtering) to provide context for future maintainers.
describe('issue 2028', () => { + // Tests fix for issue #2028: Delegate auxiliary fields for compound unique constraints + // were not being properly excluded when using includes() instead of startsWith() it('regression', async () => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ 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 (5)
README.md
(1 hunks)packages/ide/jetbrains/build.gradle.kts
(1 hunks)packages/schema/src/plugins/enhancer/enhance/index.ts
(2 hunks)packages/schema/src/plugins/zod/generator.ts
(1 hunks)tests/regression/tests/issue-2028.test.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: OSSAR-Scan
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: OSSAR-Scan
🔇 Additional comments (12)
packages/ide/jetbrains/build.gradle.kts (1)
12-12
: Version bump for patch release.The version has been incremented from 2.12.1 to 2.12.2, indicating a new patch release with backward-compatible bug fixes or minor changes.
README.md (1)
241-241
: New sponsor added to the README.A new sponsor entry ("Suhyl") has been added to the sponsors table. The entry follows the same formatting as existing sponsors with proper link, image, and styling.
packages/schema/src/plugins/zod/generator.ts (1)
247-247
: Filter logic updated to be more comprehensive.Changed field filtering from
startsWith
toincludes
for DELEGATE_AUX_RELATION_PREFIX. This modification will catch auxiliary fields that contain the prefix anywhere in their name, not just at the beginning, providing more thorough filtering.packages/schema/src/plugins/enhancer/enhance/index.ts (3)
568-568
: Improved property filtering logic.Changed property filtering from
startsWith
toincludes
for DELEGATE_AUX_RELATION_PREFIX, ensuring more thorough filtering of auxiliary fields in the interface.
571-571
: Improved method filtering logic.Changed method filtering from
startsWith
toincludes
for DELEGATE_AUX_RELATION_PREFIX, matching the same pattern update as for properties.
853-853
: Updated auxiliary declaration filtering.Changed filtering in
findAuxDecls
fromstartsWith
toincludes
, making it consistent with other similar filtering changes in the codebase.tests/regression/tests/issue-2028.test.ts (6)
1-5
: Good use of testing utilities.The test correctly leverages the appropriate testing utilities for database creation and schema loading, which makes the test setup clean and maintainable.
8-47
: Well-structured schema definition that clearly demonstrates the issue.The schema effectively models the delegation pattern with
@@delegate(type)
and type inheritance through model extensions. The relationships between models and compound unique constraints are properly defined.
49-54
: Appropriate schema loading configuration.Using
fullZod: true
is essential for this test case since you're testing the Zod schema generation behavior. The PostgreSQL provider configuration aligns with the database setup.
55-73
: Good test coverage for schema validation.The test correctly verifies that delegate auxiliary fields are excluded from the generated Zod schemas for both Bar and Baz models, which appears to be the core issue being fixed.
74-93
: Comprehensive test data setup.The test creates the necessary related entities to verify compound unique queries work correctly. This setup provides good coverage for testing the functional impact of the schema changes.
94-114
: Effective functional verification.The test correctly verifies that querying by compound unique constraints works as expected after the schema changes, ensuring both UserFolder objects can be retrieved correctly.
No description provided.