Skip to content

merge dev to main (v3.7.2)#2684

Open
ymc9 wants to merge 5 commits into
mainfrom
dev
Open

merge dev to main (v3.7.2)#2684
ymc9 wants to merge 5 commits into
mainfrom
dev

Conversation

@ymc9
Copy link
Copy Markdown
Member

@ymc9 ymc9 commented May 26, 2026

Summary by CodeRabbit

  • New Features

    • Added E.164 phone number validation support via the @phone attribute for string fields and validation rules.
  • Documentation

    • Added comprehensive README files for fetch-client and tanstack-query packages with usage examples and installation instructions.
  • Chores

    • Bumped version to 3.7.2 across all packages.
    • Updated CI/CD workflow and Node.js runtime version.

Review Change Stack

sanny-io and others added 5 commits May 23, 2026 21:27
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: ymc9 <104139426+ymc9@users.noreply.github.com>
Add README.md files for @zenstackhq/client-helpers, @zenstackhq/fetch-client,
and @zenstackhq/tanstack-query so the packages have a description on npm.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 26, 2026

Claude finished @ymc9's task —— View job


PR Review: merge dev to main (v3.7.2)

Reviewing this release PR for code quality, security, and best practices.

Review Tasks:

  • Examine version consistency across packages
  • Review CI workflow security changes
  • Analyze phone validation feature implementation
  • Check new README documentation
  • Assess test coverage for new features
  • Review overall code quality and potential issues

Analysis Complete ✅

This is a clean release PR merging dev to main for version 3.7.2. Here's my comprehensive review:

Strengths

Version Management:

  • Consistent version bump to 3.7.2 across all 38 package.json files
  • Proper semantic versioning approach for a patch release

Security Enhancements:

  • CI Workflow: Added NPM_CONFIG_PROVENANCE: 'true' for npm provenance in publish-release.yml:59
  • Permissions: Proper id-token: write permission for trusted publishing workflow
  • No secrets exposed in any of the changes

Phone Validation Feature:

  • Well-implemented: Added @phone attribute in stdlib.zmodel:557 and supporting isPhone() function:633
  • Proper validation: Uses E.164 standard (z.string().e164()) in utils.ts:76
  • Complete test coverage: Comprehensive tests in custom-validation.test.ts:84 covering edge cases
  • Type safety: Proper integration with existing validation architecture

Documentation Quality:

  • New README files for client packages are well-structured and include:
    • Clear installation instructions
    • Practical usage examples
    • Links to full documentation
  • fetch-client README: Concise API examples showing transaction usage
  • tanstack-query README: Multi-framework support clearly documented

Code Quality Assessment

Architecture:

  • Phone validation follows established patterns in codebase
  • Consistent with other validation attributes (@email, @url, @datetime)
  • No breaking changes introduced

Testing:

  • Comprehensive test coverage for new phone validation feature
  • Tests cover both positive and negative cases
  • Integration with existing validation test framework

Performance:

  • No performance concerns - validation is client-side only
  • Efficient E.164 regex validation using Zod's built-in validator

Security Review

NPM Publishing Security:

  • ✅ Added provenance support for supply chain security
  • ✅ Uses trusted publishing workflow (no long-lived tokens)
  • ✅ Proper permission scoping in CI

Input Validation:

  • ✅ Phone validation uses battle-tested E.164 standard
  • ✅ No injection vulnerabilities in validation logic
  • ✅ Proper error handling in validation functions

📋 Minor Observations

  1. No issues found - this is a well-executed release
  2. Documentation completeness - README files appropriately brief for npm packages
  3. Test coverage - Phone validation has thorough test coverage including edge cases

🎯 Recommendation

✅ APPROVE - This PR is ready for merge.

This is a high-quality release that:

  • Maintains backward compatibility
  • Adds useful phone validation functionality
  • Improves security posture with npm provenance
  • Includes proper documentation and comprehensive tests
  • Follows established patterns and conventions

No blocking issues or security concerns identified.


@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

📝 Walkthrough

Walkthrough

This PR is a v3.7.2 patch release that adds E.164 phone-number validation throughout the ZenStack platform, updates the release workflow for secure NPM publishing with OIDC provenance, adds documentation for client packages, and bumps versions across all workspace packages.

Changes

Phone Validation Feature and Release v3.7.2

Layer / File(s) Summary
Release Infrastructure Update
.github/workflows/publish-release.yml
Job permissions extended with id-token: write for OIDC token issuance, Node.js runtime updated from 22.x to 24.x, and "Publish packages" step environment changed to NPM_CONFIG_PROVENANCE: 'true'.
Phone Validation Language Definition
packages/language/res/stdlib.zmodel
@phone attribute for StringField and isPhone(field: String): Boolean validation function added to the ZModel language stdlib, enabling E.164 phone-number constraints in user schemas.
Zod Phone Validation Implementation
packages/zod/src/utils.ts
addStringValidation recognizes @phone attribute and applies Zod's e164() validator; evalCall expression evaluator extended to map isPhone function to Zod's e164() check alongside existing email/URL/datetime validators.
Test Schema Definitions for Phone Validation
packages/zod/test/schema/schema.zmodel, packages/zod/test/schema/schema.ts
Test model schemas extended with phone field annotated with @phone attribute, providing the schema foundation for validation and type-inference test coverage.
Phone Validation Test Coverage
packages/cli/test/db/pull.test.ts, packages/zod/test/factory.test.ts, tests/e2e/orm/validation/custom-validation.test.ts, tests/e2e/orm/validation/toplevel.test.ts
Comprehensive test coverage verifies phone field preservation after schema pull, type inference across omit/include/select options, phone validation acceptance and rejection with proper error messages, and e2e validation behavior in CRUD and custom-validation scenarios.
Client Package Documentation
packages/clients/client-helpers/README.md, packages/clients/fetch-client/README.md, packages/clients/tanstack-query/README.md
New package documentation added: client-helpers describes shared building blocks, fetch-client shows HTTP CRUD client usage and transactions, and tanstack-query covers framework support and React query hook examples.
Release Version Bumps Across Packages
package.json, packages/*/package.json, samples/*/package.json, tests/*/package.json
Root and all 30+ workspace packages bumped from version 3.7.1 to 3.7.2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A phone number hops in, branded E.164,
From Zod's e164(), safe and all set,
Tests validate true, docs now compile clear,
Version three-seven-point-two appears here! 📞

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'merge dev to main (v3.7.2)' is generic and describes a merge operation rather than the actual content changes; it does not convey meaningful information about the primary changes. Consider using a more descriptive title that highlights the main changes, such as 'Add @phone validation attribute and update to v3.7.2' or similar to better communicate the primary objectives.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/cli/test/db/pull.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/zod/src/utils.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/zod/test/factory.test.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 1 others

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.

Copy link
Copy Markdown
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: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

17-17: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Pin packageManager to pnpm@10.12.1.

package.json currently sets "packageManager": "pnpm@10.33.0" (line 17), conflicting with the repo guideline to pin pnpm@10.12.1. Update that field to pnpm@10.12.1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 17, Update the packageManager field in package.json
from "pnpm@10.33.0" to the pinned version "pnpm@10.12.1"; locate the
packageManager entry in package.json (the "packageManager" key) and replace its
value so it matches the repository guideline.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/clients/fetch-client/README.md`:
- Line 3: Update the package description sentence in
packages/clients/fetch-client/README.md that currently reads "auto CRUD API" to
use the hyphenated compound modifier "auto-CRUD API"; locate the string in the
README (the top paragraph describing the fetch-based client) and replace the
unhyphenated phrase with "auto-CRUD API" so the user-facing docs use correct
grammar.

---

Outside diff comments:
In `@package.json`:
- Line 17: Update the packageManager field in package.json from "pnpm@10.33.0"
to the pinned version "pnpm@10.12.1"; locate the packageManager entry in
package.json (the "packageManager" key) and replace its value so it matches the
repository guideline.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 63edb4fe-7b2c-4692-b596-1479f99f39a3

📥 Commits

Reviewing files that changed from the base of the PR and between b15bdfd and a43dff5.

📒 Files selected for processing (38)
  • .github/workflows/publish-release.yml
  • package.json
  • packages/auth-adapters/better-auth/package.json
  • packages/cli/package.json
  • packages/cli/test/db/pull.test.ts
  • packages/clients/client-helpers/README.md
  • packages/clients/client-helpers/package.json
  • packages/clients/fetch-client/README.md
  • packages/clients/fetch-client/package.json
  • packages/clients/tanstack-query/README.md
  • packages/clients/tanstack-query/package.json
  • packages/common-helpers/package.json
  • packages/config/eslint-config/package.json
  • packages/config/tsdown-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/language/res/stdlib.zmodel
  • 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
  • packages/zod/src/utils.ts
  • packages/zod/test/factory.test.ts
  • packages/zod/test/schema/schema.ts
  • packages/zod/test/schema/schema.zmodel
  • samples/orm/package.json
  • tests/e2e/orm/validation/custom-validation.test.ts
  • tests/e2e/orm/validation/toplevel.test.ts
  • tests/e2e/package.json
  • tests/regression/package.json
  • tests/runtimes/bun/package.json
  • tests/runtimes/edge-runtime/package.json

Comment thread packages/clients/fetch-client/README.md
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