-
-
Notifications
You must be signed in to change notification settings - Fork 17
merge dev to main (v3.0.0) #529
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
* chore: bump version 3.0.0 * update * update README * update
* chore: misc updates * update README * update
|
I'll analyze this and get back to you. |
|
Warning Rate limit exceeded@ymc9 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 48 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughThis PR performs a comprehensive 3.0.0 release of ZenStack, including version bumps across all packages from 3.0.0-beta.34 to 3.0.0, adds CONTRIBUTING.md documentation, updates README with new branding and sections, adds database-specific test scripts, updates CLI descriptions, implements view validation constraints, modifies type signatures for improved type inference, and updates test schemas. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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. Comment |
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.
Pull request overview
This PR merges the dev branch to main, releasing ZenStack version 3.0.0 as a stable release (upgrading from 3.0.0-beta.34). Key changes include:
- Version bumps across all packages from 3.0.0-beta.34 to 3.0.0
- New validation rules for database views (disallowing @id and @@id/@@index attributes)
- Documentation updates removing beta notices and improving clarity
- New CONTRIBUTING.md guide for contributors
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Bumped version to 3.0.0, updated npm scripts to remove beta tags, added test scripts for different database providers |
| packages/*/package.json | Updated version to 3.0.0 across all packages (cli, orm, language, server, sdk, schema, zod, testtools, plugins, clients, auth-adapters, config packages) |
| tests/*/package.json | Updated version to 3.0.0 across all test packages (e2e, regression, runtime tests) |
| samples/*/package.json | Updated version to 3.0.0 across sample projects |
| packages/language/test/view.test.ts | New test file validating that views don't allow @id, @@id, or @@index attributes but do allow @@unique |
| packages/language/src/validators/attribute-application-validator.ts | Added validation checks to reject @id, @@id, and @@index on views |
| packages/language/src/validators/datamodel-validator.ts | Skip unique criteria requirement check for views |
| packages/language/src/utils.ts | Broadened getContainingDataModel signature to accept AstNode instead of just Expression |
| tests/e2e/github-repos/cal.com/schema.zmodel | Removed @id attribute from BookingTimeStatusDenormalized view, keeping only @unique |
| tests/e2e/github-repos/cal.com/schema.ts | Updated schema definition to reflect removal of @id attribute for view |
| packages/orm/src/client/contract.ts | Added default type parameter to ClientConstructor interface for better API flexibility |
| packages/plugins/policy/plugin.zmodel | Updated documentation for check() function to correctly describe delegation behavior |
| packages/cli/src/index.ts | Updated CLI description and documentation URL (removed version-specific path) |
| README.md | Comprehensive documentation update: removed beta warnings, updated installation instructions, added sponsor section, improved feature descriptions |
| CONTRIBUTING.md | New contributor guide with development workflow, project structure, and testing instructions |
| .gitignore | Added .DS_Store to ignore macOS system files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 (3)
CONTRIBUTING.md (1)
1-109: Comprehensive contribution guide - excellent addition!The CONTRIBUTING.md provides clear and helpful guidance for new contributors, covering prerequisites, setup steps, development workflow, and project structure. The content is well-organized and thorough.
Optional: Minor wording refinements
Line 12: Consider using "PostgreSQL" instead of "postgres" for consistency with formal naming conventions.
Line 31: Consider replacing "very simple" with "straightforward" to strengthen the wording.
README.md (1)
8-8: Documentation updates for 3.0.0 release look great!The changes appropriately reflect the stable release:
- Updated branding and feature descriptions
- Installation commands now point to
@latestinstead of@next- Documentation links updated to the stable path
- Nice additions for Sponsors and Community sections
Optional: Minor markdown style improvement
Line 26: Consider wrapping the bare URL in angle brackets for better markdown compliance:
-> Read full documentation at 👉🏻 https://zenstack.dev/docs. +> Read full documentation at 👉🏻 <https://zenstack.dev/docs>.Also applies to: 26-26, 59-59, 67-67, 75-76, 85-113
packages/language/src/validators/attribute-application-validator.ts (1)
309-312: Consider adding early return after view validation error.When
@@idor@@indexis used on a view, the validation continues and may emit additional errors about thefieldsargument. Consider returning early after the view error to provide a cleaner single error message.🔎 Proposed fix
const dm = getContainingDataModel(attr); if (dm?.isView && (attr.decl.$refText === '@@id' || attr.decl.$refText === '@@index')) { accept('error', `\`${attr.decl.$refText}\` is not allowed for views`, { node: attr }); + return; }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (35)
.gitignoreCONTRIBUTING.mdREADME.mdpackage.jsonpackages/auth-adapters/better-auth/package.jsonpackages/cli/package.jsonpackages/cli/src/index.tspackages/clients/tanstack-query/package.jsonpackages/common-helpers/package.jsonpackages/config/eslint-config/package.jsonpackages/config/typescript-config/package.jsonpackages/config/vitest-config/package.jsonpackages/create-zenstack/package.jsonpackages/language/package.jsonpackages/language/src/utils.tspackages/language/src/validators/attribute-application-validator.tspackages/language/src/validators/datamodel-validator.tspackages/language/test/view.test.tspackages/orm/package.jsonpackages/orm/src/client/contract.tspackages/plugins/policy/package.jsonpackages/plugins/policy/plugin.zmodelpackages/schema/package.jsonpackages/sdk/package.jsonpackages/server/package.jsonpackages/testtools/package.jsonpackages/zod/package.jsonsamples/next.js/package.jsonsamples/orm/package.jsontests/e2e/github-repos/cal.com/schema.tstests/e2e/github-repos/cal.com/schema.zmodeltests/e2e/package.jsontests/regression/package.jsontests/runtimes/bun/package.jsontests/runtimes/edge-runtime/package.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.zmodel
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.zmodel: Always runzenstack generateafter modifying ZModel schemas
ZModel schema files should define database structure and policies that compile to TypeScript viazenstack generate
Files:
packages/plugins/policy/plugin.zmodeltests/e2e/github-repos/cal.com/schema.zmodel
tests/e2e/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
E2E tests should validate real-world schema compatibility with established projects
Files:
tests/e2e/github-repos/cal.com/schema.ts
🧠 Learnings (11)
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to **/*.zmodel : ZModel schema files should define database structure and policies that compile to TypeScript via `zenstack generate`
Applied to files:
packages/zod/package.jsonpackages/language/package.jsonpackages/schema/package.jsonCONTRIBUTING.mdREADME.md
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/e2e/**/*.{ts,tsx} : E2E tests should validate real-world schema compatibility with established projects
Applied to files:
tests/e2e/package.jsonpackages/language/test/view.test.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.test.{ts,tsx} : ORM package tests should include comprehensive client API tests and policy tests
Applied to files:
CONTRIBUTING.md
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/cli/**/*.test.{ts,tsx} : CLI package tests should focus on action-specific tests for each command
Applied to files:
CONTRIBUTING.md
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to tests/**/type*.{ts,tsx} : Ensure TypeScript inference and type coverage are validated through type coverage tests
Applied to files:
packages/language/test/view.test.ts
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Use Kysely as the query builder interface for low-level database queries, avoiding raw SQL when possible
Applied to files:
README.mdpackages/orm/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Database migrations should use Prisma CLI under the hood via ZenStack commands
Applied to files:
README.md
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to packages/zenstackhq/orm/**/*.{ts,tsx} : Implement plugin hooks at ORM, Kysely, and entity mutation levels for query interception and customization
Applied to files:
README.mdpackages/orm/package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use `pnpm` with workspaces for package management, pinned to version `pnpm10.12.1`
Applied to files:
package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Use Turbo for build orchestration and run `pnpm build`, `pnpm watch`, `pnpm lint`, and `pnpm test` for development tasks
Applied to files:
package.json
📚 Learning: 2025-11-26T01:55:04.540Z
Learnt from: CR
Repo: zenstackhq/zenstack-v3 PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-26T01:55:04.540Z
Learning: Applies to ide/vscode/**/{package.json,version.ts} : The VSCode IDE extension package should maintain a different version from other packages to comply with VSCode Marketplace requirements
Applied to files:
tests/runtimes/bun/package.json
🧬 Code graph analysis (3)
packages/language/src/utils.ts (2)
packages/language/src/ast.ts (3)
AstNode(4-4)AstNode(66-71)DataModel(49-54)packages/language/src/generated/ast.ts (2)
DataModel(377-387)DataModel(389-389)
packages/orm/src/client/contract.ts (2)
packages/schema/src/schema.ts (1)
SchemaDef(11-19)packages/orm/src/client/options.ts (1)
ClientOptions(45-110)
packages/language/src/validators/attribute-application-validator.ts (2)
packages/schema/src/schema.ts (1)
AttributeApplication(40-43)packages/language/src/utils.ts (1)
getContainingDataModel(504-513)
🪛 LanguageTool
CONTRIBUTING.md
[grammar] ~12-~12: Ensure spelling is correct
Context: ... SQLite and Postgres. You should have a postgres server (16 or above) running (either na...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[style] ~31-~31: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: ...# Development workflow ZenStack adopts a very simple development workflow: 1. Changes shou...
(EN_WEAK_ADJECTIVE)
[style] ~107-~107: Consider shortening or rephrasing this to strengthen your wording.
Context: ...the packages in the workspace. Once you make changes to a package and rebuild it, the sample pr...
(MAKE_CHANGES)
🪛 markdownlint-cli2 (0.18.1)
README.md
26-26: Bare URL used
(MD034, no-bare-urls)
⏰ 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: Agent
- GitHub Check: claude-review
- GitHub Check: build-test (20.x, postgresql)
- GitHub Check: build-test (20.x, sqlite)
🔇 Additional comments (34)
tests/runtimes/edge-runtime/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
packages/orm/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
samples/orm/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
packages/config/vitest-config/package.json (1)
4-4: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
packages/server/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
packages/config/typescript-config/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
samples/next.js/package.json (1)
3-3: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
packages/language/package.json (1)
4-4: LGTM! Version bump aligns with v3.0.0 release.The version update from beta to stable is appropriate for the coordinated v3.0.0 release across the monorepo.
tests/e2e/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update from beta to stable release is consistent with the PR objective.
packages/clients/tanstack-query/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update is appropriate for the stable release.
packages/common-helpers/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update is consistent with the monorepo-wide release.
tests/regression/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update aligns with the workspace-wide release.
packages/auth-adapters/better-auth/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update is appropriate for the stable release of the Better Auth adapter.
packages/zod/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update is consistent with the monorepo-wide release.
.gitignore (1)
11-11: LGTM! Standard macOS system file exclusion.Adding
.DS_Storeto.gitignoreis a common best practice to prevent macOS system metadata from being committed to the repository.packages/sdk/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version update is appropriate for the stable release of the SDK package.
packages/testtools/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
packages/plugins/policy/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
tests/e2e/github-repos/cal.com/schema.zmodel (1)
1650-1650: Ensurezenstack generatehas been run after this schema change.The removal of
@idfrom the view's id field aligns with view-specific validation constraints. As per coding guidelines, please confirm thatzenstack generatehas been executed after modifying this ZModel schema.Based on coding guidelines: ZModel schema files should define database structure and policies that compile to TypeScript via
zenstack generate.tests/runtimes/bun/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
packages/config/eslint-config/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
packages/create-zenstack/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
packages/schema/package.json (1)
3-3: LGTM! Version bump for 3.0.0 release.The version bump from 3.0.0-beta.34 to 3.0.0 is appropriate for the final release.
packages/cli/src/index.ts (1)
53-53: LGTM! CLI description and documentation URL updated for 3.0.0 release.The updated description text and simplified docs URL appropriately reflect the 3.0.0 release branding and documentation structure.
packages/language/src/utils.ts (1)
504-513: LGTM! Backward-compatible type broadening.Widening the parameter type from
ExpressiontoAstNodeis a safe change sinceExpressionis a subtype ofAstNode. The function body only relies on the$containerproperty fromAstNode, so the implementation remains correct. This enables validators to retrieve the containingDataModelfrom any AST node type, as needed for the view-aware validation work.tests/e2e/github-repos/cal.com/schema.ts (1)
6658-6663: Viewidattribute change is consistent with new view constraintsDropping the
@idattribute forBookingTimeStatusDenormalized.idwhile keepingid: true,unique: true, and@uniquematches the pattern already used for other views (e.g.,BookingTimeStatus) and aligns with the new rule that views shouldn’t declare@id/@@idbut may still have a unique logical key. This keeps the e2e cal.com fixture representative while complying with the updated validator semantics, as per coding guidelines for real‑world schema compatibility.packages/plugins/policy/plugin.zmodel (1)
36-38: Documentation improvement looks good.The updated description more accurately conveys the delegation semantics of the
checkfunction. The clarification that only to-one relations are supported is helpful.Based on coding guidelines, remember to run
zenstack generateafter modifying ZModel schemas.packages/orm/src/client/contract.ts (1)
246-246: Type inference improvement LGTM.Adding a default value for the
Optionsgeneric parameter improves the developer experience by enabling better type inference when the parameter doesn't need to be explicitly specified.packages/cli/package.json (1)
6-6: Version bump to 3.0.0 looks good.The version update from beta to stable release is appropriate for this PR's objectives.
packages/language/src/validators/datamodel-validator.ts (1)
53-53: View exemption from unique criteria validation is appropriate.Exempting views from the requirement to have unique criteria makes sense, as views are read-only database objects that don't need the same constraints as regular models. This change aligns well with the view validation tests introduced in this PR.
packages/language/test/view.test.ts (1)
1-84: Well-structured test suite for view validation.The test cases comprehensively cover the new view validation constraints:
- Regular views work without unique criteria
- Disallowed constructs (@id, @@id, @@index) are properly rejected
- Allowed constructs (@@unique) are accepted
The test structure follows Vitest conventions and aligns well with the validator changes.
package.json (1)
3-3: Root package updates for 3.0.0 release LGTM.The changes appropriately support the stable release:
- Version bump to 3.0.0
- Database-specific test scripts (
test:sqlite,test:pg,test:all) enable flexible testing workflows- Publish scripts updated to remove the
--tag nextflagThese align well with the testing guidance in CONTRIBUTING.md.
Also applies to: 12-14, 19-20
packages/language/src/validators/attribute-application-validator.ts (2)
30-30: LGTM!The import of
getContainingDataModelis correctly added and appropriately placed with other utility imports from the same module.
297-303: LGTM!The new
_checkIdvalidation correctly prevents@idfrom being used on view data models. The implementation follows the established pattern for attribute checkers, and the error message is clear and consistent.
|
Claude finished @ymc9's task —— View job PR Review: ZenStack v3.0.0 ReleaseThis is a comprehensive review of the v3.0.0 stable release PR merging Review Tasks
✅ Strengths1. Version Management Excellence
2. Robust View Validation ImplementationThe new view validation feature is well-implemented:
3. Documentation Improvements
4. Type System Enhancements
|

Summary by CodeRabbit
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.