Skip to content

merge dev to main (v3.4.4)#2451

Merged
ymc9 merged 6 commits intomainfrom
dev
Mar 5, 2026
Merged

merge dev to main (v3.4.4)#2451
ymc9 merged 6 commits intomainfrom
dev

Conversation

@ymc9
Copy link
Member

@ymc9 ymc9 commented Mar 5, 2026

Summary by CodeRabbit

Release 3.4.4

  • New Features

    • Enhanced plugin system with improved module loading and validation.
  • Bug Fixes

    • Fixed cyclic dependency errors occurring with self-referential model relations.
    • Improved plugin resolution and error messaging during schema validation.
  • Chores

    • Updated CI/CD workflows to standard GitHub Actions versions.

jiashengguo and others added 6 commits March 4, 2026 14:54
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
… schema push (#2449)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ffed7701-a1c4-48d6-a863-f63b74f1e9ff

📥 Commits

Reviewing files that changed from the base of the PR and between 51b86db and 75d77de.

📒 Files selected for processing (36)
  • .github/workflows/build-test.yml
  • .github/workflows/claude-code-review.yml
  • package.json
  • packages/auth-adapters/better-auth/package.json
  • packages/cli/package.json
  • packages/cli/src/actions/action-utils.ts
  • packages/cli/src/actions/check.ts
  • packages/cli/src/actions/generate.ts
  • packages/cli/src/actions/proxy.ts
  • packages/cli/test/check.test.ts
  • packages/cli/test/generate.test.ts
  • packages/clients/client-helpers/package.json
  • packages/clients/tanstack-query/package.json
  • packages/common-helpers/package.json
  • packages/config/eslint-config/package.json
  • packages/config/typescript-config/package.json
  • packages/config/vitest-config/package.json
  • packages/create-zenstack/package.json
  • packages/ide/vscode/package.json
  • packages/language/package.json
  • packages/orm/package.json
  • packages/orm/src/client/helpers/schema-db-pusher.ts
  • packages/plugins/policy/package.json
  • packages/schema/package.json
  • packages/sdk/package.json
  • packages/server/package.json
  • packages/testtools/package.json
  • packages/zod/package.json
  • samples/orm/package.json
  • tests/e2e/package.json
  • tests/regression/package.json
  • tests/regression/test/issue-2435.test.ts
  • tests/runtimes/bun/package.json
  • tests/runtimes/bun/schemas/schema.zmodel
  • tests/runtimes/edge-runtime/package.json
  • tests/runtimes/edge-runtime/schemas/schema.zmodel

📝 Walkthrough

Walkthrough

This pull request contains a version bump from 3.4.3 to 3.4.4 across all packages, alongside new plugin loading infrastructure in the CLI, bug fixes for self-referential relations, GitHub workflow improvements, and updated test schemas to reflect new plugin provider paths.

Changes

Cohort / File(s) Summary
Version Bumps
package.json, packages/auth-adapters/better-auth/package.json, packages/cli/package.json, packages/clients/*/package.json, packages/common-helpers/package.json, packages/config/*/package.json, packages/create-zenstack/package.json, packages/ide/vscode/package.json, packages/language/package.json, packages/orm/package.json, packages/plugins/policy/package.json, packages/schema/package.json, packages/sdk/package.json, packages/server/package.json, packages/testtools/package.json, packages/zod/package.json, samples/orm/package.json, tests/e2e/package.json, tests/regression/package.json, tests/runtimes/*/package.json
Version incremented from 3.4.3 to 3.4.4 across 25 package.json files (no functional changes).
Plugin Loading Infrastructure
packages/cli/src/actions/action-utils.ts, packages/cli/src/actions/check.ts, packages/cli/src/actions/generate.ts
Added plugin support utilities: getPluginProvider() and loadPluginModule() for dynamic plugin resolution and loading; check.ts now validates plugin resolution during schema validation; generate.ts refactored to use centralized plugin utilities instead of inline logic.
Plugin Support Tests
packages/cli/test/check.test.ts, packages/cli/test/generate.test.ts
New test suites validating plugin resolution success/failure paths, non-existent plugin module error handling, plugin option precedence, and fallback behavior when plugin modules lack CLI generators.
Self-Referential Relations Fix
packages/orm/src/client/helpers/schema-db-pusher.ts, tests/regression/test/issue-2435.test.ts
Added logic to skip self-referential relation edges in topological sort to prevent false cycle detection; regression test verifies self-referential models within delegated types resolve without cyclic errors.
Unsupported Field Omission
packages/cli/src/actions/proxy.ts
Expanded field omission logic to exclude fields of type 'Unsupported' in addition to computed fields; variable renamed from computedFields to omitFields for clarity.
Workflow Updates
.github/workflows/build-test.yml, .github/workflows/claude-code-review.yml
build-test.yml: switched runner from buildjet-8vcpu-ubuntu-2204 to ubuntu-latest and updated GitHub Actions to current versions (actions/setup-node@v4, actions/cache@v4); claude-code-review.yml: added condition to skip non-fork PRs and guard to skip reviews when PR title contains "[WIP]".
Plugin Provider Path Updates
tests/runtimes/bun/schemas/schema.zmodel, tests/runtimes/edge-runtime/schemas/schema.zmodel
Updated plugin policy provider paths from relative package directory to explicit plugin.zmodel file path (e.g., ../../../packages/plugins/policy../../../../packages/plugins/policy/plugin.zmodel).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #2449 — Directly related: modifies schema-db-pusher.ts to skip self-referential relation edges and includes matching regression test for issue-2435.
  • #2444 — Directly related: updates .github/workflows/claude-code-review.yml with identical non-fork condition and "[WIP]" skip logic.
  • #2447 — Directly related: adds plugin loading utilities (getPluginProvider, loadPluginModule) in CLI action files and includes corresponding test coverage for plugin resolution scenarios.

Poem

🐰 Bumping hops to 3.4.4,
Plugins load forevermore,
Self-referential loops now clear,
Workflows swift, without a fear,
Code review done with cheer! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'merge dev to main (v3.4.4)' accurately reflects the main objective of merging the dev branch to main with version 3.4.4. The changeset includes version bumps across all packages to 3.4.4, plugin loading refactoring, workflow updates, and bug fixes—all consistent with a release merge.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

@claude
Copy link
Contributor

claude bot commented Mar 5, 2026

Claude finished @ymc9's task —— View job


Code Review for v3.4.4 Release

I've completed a thorough review of this release PR. Here's my detailed analysis:

Todo List:

  • Set up development environment
  • Review version updates for consistency
  • Analyze CLI refactoring changes
  • Review bug fix for self-referential relations
  • Check new regression test
  • Examine build system changes
  • Run tests and linting
  • Provide final review summary

🟢 Overall Assessment: APPROVED

This is a well-structured release PR with good code quality and proper bug fixes.

Code Quality & Best Practices ✅

Excellent CLI Refactoring (packages/cli/src/actions/)

  • Clean separation of concerns: Moving utility functions from generate.ts to action-utils.ts is excellent refactoring
  • Improved maintainability: Functions like getSchemaFile, loadSchemaDocument, generateTempPrismaSchema are now reusable across actions
  • Good error handling: Proper error propagation with CliError class throughout

Strong Type Safety

  • Proper TypeScript usage with good type annotations
  • Overloaded function signatures in loadSchemaDocument are well-designed
  • Good use of generic constraints and utility types

Bug Fix Quality 🐛➡️✅

Self-Referential Relations Fix (packages/orm/src/client/helpers/schema-db-pusher.ts:87-90)

// skip self-referential relations to avoid false cycle in toposort
if (field.type === model.name) {
    continue;
}
  • Perfect fix: Simple and targeted solution that addresses the root cause
  • Low risk: Minimal change that only affects the specific problematic case
  • Well-tested: Includes comprehensive regression test in tests/regression/test/issue-2435.test.ts

Security Considerations 🔒

Network Operations

  • Usage tips fetch has proper timeouts (FETCH_CLI_MAX_TIME = 1000ms) - Good!
  • Uses AbortController for cancellation - Excellent pattern!
  • Graceful fallback on network failures - No security risks

Plugin Loading (packages/cli/src/actions/action-utils.ts:232-306)

  • Potential concern: Dynamic module loading with jiti and ES imports
  • Mitigated by: Proper error handling and sandboxing
  • Recommendation: Consider adding validation for plugin sources in future

Performance Considerations ⚡

CLI Improvements

  • Background fetch pattern for usage tips is excellent - doesn't block CLI execution
  • Debounced file watching (500ms) prevents excessive regeneration
  • Efficient file resolution with proper fallback chain

Schema Processing

  • Topological sort optimization: The bug fix actually improves performance by avoiding unnecessary cycles
  • Lazy plugin loading: Modules only loaded when needed

Test Coverage 📋

Excellent Test Strategy

  • Comprehensive regression test: issue-2435.test.ts covers the exact bug scenario
  • CLI command tests: Good coverage of generate command variations
  • Integration tests: Tests real-world schema scenarios with delegate models

Missing Areas (Minor)

  • Could add more edge case tests for the new utility functions
  • Performance regression tests for large schema files would be valuable

Version Consistency ✅

All packages correctly updated to 3.4.4:

  • 18 packages total, all properly versioned
  • IDE extension correctly versioned (note: VSCode extension follows different versioning as documented)
  • Config packages properly updated

Build System Changes 🔧

CI Migration (BuildJet → GitHub-hosted runners)

  • Good change: Reduces external dependencies
  • Proper configuration: Matrix strategy maintained
  • No functionality loss: All test scenarios preserved

Minor Suggestions

  1. Documentation: Consider adding JSDoc comments to new utility functions in action-utils.ts
  2. Error messages: Could enhance error messages in plugin loading for better developer experience
  3. Monitoring: Consider adding telemetry for plugin loading failures (opt-in)

Potential Issues (None Critical)

  • Plugin security: While current implementation is safe, consider adding plugin signature validation for future
  • Memory usage: Large schemas with many self-referential relations should be monitored

RECOMMENDATION: MERGE

This is a solid release with:

  • ✅ High-quality bug fix with proper testing
  • ✅ Good refactoring that improves code maintainability
  • ✅ Consistent version updates across all packages
  • ✅ No security or performance regressions introduced
  • ✅ Comprehensive test coverage for changes

The CLI refactoring and bug fix are both excellent examples of careful, thoughtful development.


@ymc9 ymc9 merged commit 552b634 into main Mar 5, 2026
11 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