- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 126
merge dev to main (v2.21.0) #2290
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
…opped upon return (#2286)
| 📝 WalkthroughWalkthroughUpdates documentation with ZenStack v3 beta information, bumps JetBrains IDE plugin version, enhances policy field-level visibility checks for select/include semantics, adds Zod major version support (v3/v4) to code generation, extends test tooling with database file configuration, and adds a new regression test. Changes
 Sequence DiagramsequenceDiagram
    participant Query as Query Layer
    participant PolicyEval as Policy Evaluation
    participant FieldVis as Field Visibility
    participant Result as Result
    Query->>PolicyEval: queryArgs with select/include
    PolicyEval->>FieldVis: Check hasFieldLevelPolicy
    alt Field-Level Policy Enabled
        FieldVis->>FieldVis: Apply select/include filters
        Note over FieldVis: Remove non-selected scalars<br/>Remove non-included relations
        FieldVis->>FieldVis: Apply existing omit handling
        FieldVis->>PolicyEval: Filtered fields + checks
    else No Field-Level Policy
        FieldVis->>PolicyEval: Original fields
    end
    PolicyEval->>PolicyEval: Evaluate read authorization
    PolicyEval->>FieldVis: Identify unreadable fields
    FieldVis->>FieldVis: Remove unreadable fields
    FieldVis->>Result: Final sanitized result
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 
 Possibly related PRs
 Pre-merge checks and finishing touches❌ Failed checks (1 warning, 2 inconclusive)
 ✨ Finishing touches
 🧪 Generate unit tests (beta)
 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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (15)
- package.jsonis excluded by- !**/*.json
- packages/ide/jetbrains/package.jsonis excluded by- !**/*.json
- packages/language/package.jsonis excluded by- !**/*.json
- packages/misc/redwood/package.jsonis excluded by- !**/*.json
- packages/plugins/openapi/package.jsonis excluded by- !**/*.json
- packages/plugins/swr/package.jsonis excluded by- !**/*.json
- packages/plugins/tanstack-query/package.jsonis excluded by- !**/*.json
- packages/plugins/trpc/package.jsonis excluded by- !**/*.json
- packages/runtime/package.jsonis excluded by- !**/*.json
- packages/schema/package.jsonis excluded by- !**/*.json
- packages/sdk/package.jsonis excluded by- !**/*.json
- packages/server/package.jsonis excluded by- !**/*.json
- packages/testtools/package.jsonis excluded by- !**/*.json
- pnpm-lock.yamlis excluded by- !**/pnpm-lock.yaml,- !**/*.yaml
- tests/regression/tests/issue-2283/dev.dbis excluded by- !**/*.db,- !**/*.db
📒 Files selected for processing (10)
- README.md(1 hunks)
- packages/ide/jetbrains/build.gradle.kts(1 hunks)
- packages/runtime/src/enhancements/node/policy/policy-utils.ts(1 hunks)
- packages/schema/src/plugins/zod/generator.ts(8 hunks)
- packages/schema/src/plugins/zod/transformer.ts(8 hunks)
- packages/schema/src/plugins/zod/types.ts(1 hunks)
- packages/server/tests/adapter/elysia.test.ts(1 hunks)
- packages/testtools/src/schema.ts(2 hunks)
- tests/regression/tests/issue-1378.test.ts(1 hunks)
- tests/regression/tests/issue-2283/regression.test.ts(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
tests/regression/tests/issue-2283/regression.test.ts (1)
packages/testtools/src/schema.ts (1)
loadSchema(173-249)
packages/schema/src/plugins/zod/generator.ts (2)
packages/sdk/src/types.ts (1)
PluginError(115-119)packages/schema/src/plugins/zod/index.ts (1)
name(5-5)
packages/schema/src/plugins/zod/transformer.ts (2)
packages/runtime/src/local-helpers/upper-case-first.ts (1)
upperCaseFirst(1-3)packages/sdk/src/utils.ts (1)
indentString(129-132)
⏰ 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). (5)
- GitHub Check: OSSAR-Scan
- GitHub Check: build-test (20.x)
- GitHub Check: build-test (20.x)
- GitHub Check: dependency-review
- GitHub Check: build-test (20.x)
🔇 Additional comments (6)
packages/ide/jetbrains/build.gradle.kts (1)
12-12: Version bump correctly applied and consistent with PR objectives.The version has been properly updated from 2.20.1 to 2.21.0, matching the PR title and objectives. The version string is correctly referenced in the changelog header generation on line 84 via
${version.get()}, ensuring consistency across the plugin metadata.packages/server/tests/adapter/elysia.test.ts (1)
87-89: Verify and document the root cause of the CI failure before merging to main.The test is skipped with only a vague "failing in CI" comment, but lacks:
- The specific failure mode or error message
- A tracked GitHub issue number for this regression
- Clarity on whether this is a flaky/temporal issue or a real bug
Since this change is being merged to main (v2.21.0), skipping important functionality testing without proper tracking could mask real issues. Verify that:
- There's a corresponding GitHub issue tracking this failure
- The root cause has been diagnosed
- The skip is intentional (rather than a workaround for an unresolved bug)
Can you provide the GitHub issue number that tracks this failure and clarify the specific error occurring in CI?
packages/testtools/src/schema.ts (1)
153-153: LGTM! Clean API extension.The new optional
dbFileparameter extends the test tooling surface appropriately for pre-populated database scenarios.tests/regression/tests/issue-2283/regression.test.ts (2)
4-683: Well-structured regression test for nested query field visibility.The test appropriately exercises:
- Complex schema with multiple models and relations
- Access control rules using
@@allowdirectives- Nested queries with explicit
selectclauses- Field-level visibility verification (unselected field should be undefined)
The assertion on line 681 correctly validates that the
modulefield is undefined on the Class object since it wasn't included in the select clause, which tests proper field filtering in deeply nested queries under access control.
637-637: No issues found—the dev.db file exists at the expected location.The verification confirms that
tests/regression/tests/issue-2283/dev.dbis present in the repository and properly committed.packages/runtime/src/enhancements/node/policy/policy-utils.ts (1)
1537-1547: Select/include pre-filter keeps payload alignedRespecting
select/includebefore policy checks plugs the gap where supplemental selectors leaked into responses when no field-level policy was present. This matches Prisma semantics and makes the later readability pruning consistent. Nice catch.
No description provided.