Skip to content

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Dec 29, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

📝 Walkthrough

Walkthrough

Bumps JetBrains IDE plugin version to 2.22.2. Adds multi-version Zod runtime compatibility by introducing a version selector in policy utilities. Converts Zod imports to type-only in validation and utility modules. Adds Prisma v7 DMMF loader support. Updates schema README with v2 compatibility note.

Changes

Cohort / File(s) Summary
JetBrains IDE version bump
packages/ide/jetbrains/build.gradle.kts
Version property updated from 2.22.1 to 2.22.2
Zod multi-version runtime support
packages/runtime/src/enhancements/node/policy/policy-utils.ts
Introduced runtime selector (useZod) to choose between zod/v3 and zod/v4 based on schema metadata; updated password-override logic to use selected version; switched to type-only imports with explicit v3/v4 imports
Zod type-only imports
packages/runtime/src/validation.ts, packages/runtime/src/zod-utils.ts
Changed runtime zod imports to type-only imports (affects type usage only, e.g., z.ZodType)
Prisma v7 DMMF support
packages/sdk/src/prisma.ts
Added _getDMMF7 import and conditional logic to use Prisma v7 DMMF loader when version >= 7.0.0; added normalizedRelative import and reordered imports
Documentation
packages/schema/README.md
Added top-of-file note indicating extension targets ZenStack v2 with reference to v3 language tools

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~9 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, so assessment cannot be made based on description content. Add a pull request description explaining the changes, improvements, or fixes included in this merge (e.g., summary of new features, bug fixes, or version-related updates).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'merge dev to main (v2.22.2)' accurately describes the primary change—merging dev branch to main with version bump to 2.22.2, which is reflected in the version update across the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57354f8 and 0173706.

⛔ 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 (6)
  • packages/ide/jetbrains/build.gradle.kts
  • packages/runtime/src/enhancements/node/policy/policy-utils.ts
  • packages/runtime/src/validation.ts
  • packages/runtime/src/zod-utils.ts
  • packages/schema/README.md
  • packages/sdk/src/prisma.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/runtime/src/enhancements/node/policy/policy-utils.ts (1)
packages/runtime/src/local-helpers/lower-case-first.ts (1)
  • lowerCaseFirst (1-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: dependency-review
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
  • GitHub Check: build-test (20.x)
🔇 Additional comments (9)
packages/schema/README.md (1)

3-4: LGTM! Clear version targeting documentation.

The note effectively communicates version compatibility to users, directing them to the appropriate extension for ZenStack v3.

packages/runtime/src/zod-utils.ts (1)

2-2: LGTM! Correct type-only import pattern.

The change to import type is appropriate since Z is used exclusively for type annotations throughout the file (e.g., Z.ZodSchema, Z.ZodObject), while runtime Zod operations use the dynamically passed z parameter. This aligns with the multi-version Zod compatibility strategy.

packages/runtime/src/validation.ts (1)

1-1: LGTM! Type-only import correctly applied.

The change to import type is correct. The z namespace is used exclusively for type annotations (z.ZodType on line 14, z.ZodError on line 18), not runtime values. Runtime validation uses the passed validator parameter.

packages/ide/jetbrains/build.gradle.kts (1)

12-12: LGTM! Version bump matches release.

The version increment to 2.22.2 aligns with the PR title and is a standard release version update.

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

1547-1556: Minor formatting adjustment - no semantic change.

The reformatting of the conditional improves readability without altering logic.


1380-1398: Verify Zod version detection mechanism.

The runtime version selection using schema._def to distinguish between Zod v3 and v4 is creative, but please verify:

  1. Is schema._def a reliable and stable way to detect Zod v3 vs v4?
  2. What happens if a schema doesn't have _def (Zod v4) but is actually a different Zod version?
  3. Are there edge cases where this detection might fail?
How to reliably detect Zod v3 vs Zod v4 at runtime? Is checking _def property a stable approach?

4-6: The imports for zod/v3 and zod/v4 are officially supported by Zod and documented for library authors. The code correctly handles multi-version compatibility by using runtime detection (schema._def) to select the appropriate version.

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

5-5: Verify the repository state and package.json files.

The @prisma/internals-v7 import statement exists in the file, but the repository appears to be missing all package.json files needed to verify dependency declarations. Confirm that package.json files exist and contain the @prisma/internals-v7 dependency in the appropriate configuration.


54-61: API compatibility is confirmed.

Both _getDMMF from @prisma/internals and _getDMMF7 from @prisma/internals-v7 accept the same GetDMMFOptions type (datamodel: SchemaFileInput and optional previewFeatures?: string[]) and return Promise<DMMF.Document>. The conditional routing logic is correct and supports seamless version switching.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@ymc9 ymc9 merged commit 2bc0e5b into main Dec 29, 2025
9 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