Skip to content

merge dev to main (v2.13.1) #2068

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

Merged
merged 5 commits into from
Apr 4, 2025
Merged

merge dev to main (v2.13.1) #2068

merged 5 commits into from
Apr 4, 2025

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Apr 4, 2025

No description provided.

Copy link
Contributor

coderabbitai bot commented Apr 4, 2025

📝 Walkthrough

Walkthrough

The pull request updates the project changelog and version, enhances the Prisma import logic by adding a new target parameter for environment-specific imports, refines JSON field handling to account for optional fields with $Types.Skip, and reorders a variable declaration in the REST API handler. Additionally, new tests have been introduced for REST filtering and JSON field operations to validate these changes.

Changes

File(s) Change Summary
packages/ide/jetbrains/CHANGELOG.md
packages/ide/jetbrains/build.gradle.kts
Updated the changelog with a new "Unreleased" entry for @default attribute support on @json fields and added a new "Fixed" section (empty). The project's version was bumped from 2.13.0 to 2.13.1.
packages/schema/src/plugins/enhancer/enhance/index.ts Modified the createSimplePrismaImports and createLogicalPrismaImports methods to accept an additional target parameter for selecting between standard and edge Prisma clients. Enhanced the replacePrismaJson logic to check for optional JSON fields and apply $Types.Skip where appropriate.
packages/server/src/api/rest/index.ts Reordered the declaration of the currType variable within the buildFilter method to adjust its scope without impacting functionality.
packages/server/tests/api/rest.test.ts
tests/integration/tests/enhancements/json/crud.test.ts
Added test cases: two tests for REST API filtering based on author email and post title, and a new integration test ("works with Prisma.skip") validating JSON field CRUD operations using Prisma’s skip functionality.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant EG as EnhancerGenerator
    Caller->>EG: Request Prisma import generation (prismaImport, target)
    Note over EG: Inside createSimplePrismaImports/createLogicalPrismaImports
    EG->>EG: Check if target is "node" or "edge"
    EG-->>Caller: Return environment-specific Prisma import string
Loading

Possibly related PRs

✨ 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 plan to trigger planning for file edits and PR creation.
  • @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.

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: 0

🧹 Nitpick comments (1)
packages/ide/jetbrains/CHANGELOG.md (1)

7-8: Empty "Fixed" Section Notice
A new "Fixed" section has been introduced but it appears to be empty. Consider adding a placeholder (e.g., "No fixes in this release") or removing the header until there are fixes to report to avoid potential confusion for readers.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a62f63 and 4608cb9.

⛔ 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 (6)
  • packages/ide/jetbrains/CHANGELOG.md (1 hunks)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/schema/src/plugins/enhancer/enhance/index.ts (4 hunks)
  • packages/server/src/api/rest/index.ts (1 hunks)
  • packages/server/tests/api/rest.test.ts (1 hunks)
  • tests/integration/tests/enhancements/json/crud.test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: OSSAR-Scan
🔇 Additional comments (9)
packages/ide/jetbrains/build.gradle.kts (1)

12-12: Update: Project Version Updated
The project version has been updated to "2.13.1" as intended with this release cycle. This change is straightforward and follows our versioning guidelines.

packages/ide/jetbrains/CHANGELOG.md (1)

5-6: Changelog Entry for JSON Default Support
The new bullet point "Support @default for @json fields" under the "Unreleased" section clearly documents the enhancement to JSON field handling. This aligns with the changes made in the Prisma import logic and related updates.

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

636-655: Well-implemented test cases for combined filtering.

These new test cases effectively validate that the REST API correctly handles combined filtering on both the author's email and post title simultaneously. The first test ensures a match when both conditions are met, while the second verifies no results when one condition fails. This provides good coverage for the multi-filtering functionality.

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

1556-1557: Improved variable declaration timing.

The currType variable declaration has been moved to be initialized after item is defined but before its first usage, which is a good practice for keeping variable scopes tight.

tests/integration/tests/enhancements/json/crud.test.ts (1)

433-493: Good test coverage for Prisma.skip functionality.

This test comprehensively verifies the behavior of Prisma.skip with JSON fields:

  1. It confirms non-optional JSON fields can't be skipped in create operations (with a ts-expect-error)
  2. It verifies skip works correctly for update operations
  3. It ensures the original JSON data is preserved when using skip

This is particularly valuable as it validates the @json field handling logic with the new Prisma.skip feature.

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

152-156: Good enhancement for environment-specific imports

The code now correctly passes the target parameter to the Prisma import functions, allowing for environment-specific imports based on whether the code is running in Node.js or Edge runtime.


209-213: Well-implemented target-specific imports

The updated method signature and implementation for createSimplePrismaImports now properly handles different runtime targets by conditionally adjusting the import path. This change aligns with the edge runtime support mentioned in the PR summary.


240-242: Good parallel implementation for logical imports

The method signature update for createLogicalPrismaImports consistently applies the same pattern of target-specific imports as seen in the simple imports function. This ensures consistent behavior across both import types.


830-844: Improved JSON field handling for optional fields

The enhanced implementation now properly handles optional JSON fields by detecting if a field has a question mark and adding $Types.Skip type to the union. This improvement provides better type safety when working with Prisma's skip functionality for optional fields.

@ymc9 ymc9 enabled auto-merge April 4, 2025 05:15
@ymc9 ymc9 disabled auto-merge April 4, 2025 05:15
@ymc9 ymc9 merged commit 79197c6 into main Apr 4, 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