Skip to content
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

merge dev to main (v2.2.3) #1514

Merged
merged 2 commits into from
Jun 14, 2024
Merged

merge dev to main (v2.2.3) #1514

merged 2 commits into from
Jun 14, 2024

Conversation

ymc9
Copy link
Member

@ymc9 ymc9 commented Jun 14, 2024

No description provided.

Copy link
Contributor

coderabbitai bot commented Jun 14, 2024

Walkthrough

Walkthrough

This update includes enhancements and maintenance changes across different parts of the project. A new link to a "Mermaid Chart" with a GitHub avatar is added to the README. The JetBrains IDE plugin version is incremented from 2.2.2 to 2.2.3. Conditional logic has been introduced in the ExpressionValidator class to improve field comparison validations. A new test case focusing on cross-model field comparisons with authorization logic is added to ensure robustness.

Changes

File Summary
README.md Added a new table cell containing a link to "Mermaid Chart" with its GitHub avatar.
packages/ide/jetbrains/build.gradle.kts Updated the JetBrains IDE plugin version from 2.2.2 to 2.2.3 in the dev.zenstack group.
packages/schema/src/language-server/validator/expression-validator.ts Added conditional checks in the ExpressionValidator class, restricting certain method calls based on the expr.operator value. Updated imports from @zenstackhq/testtools.
tests/integration/tests/enhancements/with-policy/cross-model-field-comparison.test.ts Added a new test case for authorization logic in cross-model field comparison. Updated imports from @zenstackhq/testtools.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a2d3377 and 908048b.

Files ignored due to path filters (13)
  • 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
Files selected for processing (4)
  • README.md (1 hunks)
  • packages/ide/jetbrains/build.gradle.kts (1 hunks)
  • packages/schema/src/language-server/validator/expression-validator.ts (1 hunks)
  • tests/integration/tests/enhancements/with-policy/cross-model-field-comparison.test.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • packages/ide/jetbrains/build.gradle.kts
Additional context used
LanguageTool
README.md

[uncategorized] ~173-~173: The official spelling of this programming framework is “Express.js”. (NODE_JS)
Context: ...reference/server-adapters/fastify) - [ExpressJS](https://zenstack.dev/docs/reference/se...


[grammar] ~198-~198: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”? (TO_DO_HYPHEN)
Context: ...) as an introduction. ### Multi-Tenant Todo App Check out the [Multi-tenant Todo A...


[grammar] ~200-~200: It appears that a hyphen is missing in the noun “To-do” (= task) or did you mean the verb “to do”? (TO_DO_HYPHEN)
Context: ...t Todo App Check out the Multi-tenant Todo App...


[style] ~229-~229: Consider using a different verb to strengthen your wording. (SPEED_UP_ACCELERATE)
Context: ...ps://github.com/sponsors/zenstackhq) to speed up the development. Your contribution will...


[style] ~249-~249: The wording of this phrase can be improved. (MAKE_STYLE_BETTER)
Context: ...to all the contributors who have helped make ZenStack better! #### Source <a href="https://github....

Markdownlint
README.md

251-251: Expected: h3; Actual: h4 (MD001, heading-increment)
Heading levels should only increment by one level at a time


5-5: null (MD045, no-alt-text)
Images should have alternate text (alt text)


10-10: null (MD045, no-alt-text)
Images should have alternate text (alt text)


13-13: null (MD045, no-alt-text)
Images should have alternate text (alt text)


15-15: null (MD045, no-alt-text)
Images should have alternate text (alt text)


17-17: null (MD045, no-alt-text)
Images should have alternate text (alt text)


20-20: null (MD045, no-alt-text)
Images should have alternate text (alt text)


23-23: null (MD045, no-alt-text)
Images should have alternate text (alt text)


254-254: null (MD045, no-alt-text)
Images should have alternate text (alt text)


260-260: null (MD045, no-alt-text)
Images should have alternate text (alt text)

Additional comments not posted (3)
packages/schema/src/language-server/validator/expression-validator.ts (1)

143-145: Ensure the conditional logic correctly encapsulates the desired behavior without unintended side effects.

This modification improves the robustness of the validation by preventing unnecessary calls to validateCrossModelFieldComparison when dealing with logical operators. It's a good practice to isolate specific conditions like this to prevent potential bugs in complex expressions.

tests/integration/tests/enhancements/with-policy/cross-model-field-comparison.test.ts (2)

1-1: The import statement has been updated to include loadModel from @zenstackhq/testtools, which aligns with the changes described in the AI-generated summary.


1001-1027: New test case added for "with auth case 4", which tests authorization logic using the loadModel function. This test case seems to be well-structured but ensure that the Foo and Bar models are properly defined and that the private field in the Bar model is correctly utilized in the authorization logic.

Verification successful

The Foo and Bar models are defined correctly in the test file, and the private field in the Bar model is utilized in the authorization logic.

  • The Foo model is defined in multiple files, including the test file in question.
  • The Bar model is also defined in multiple files, including the test file in question.
  • The private field in the Bar model is used in the authorization logic in the test file.

Locations in the codebase:

  • tests/integration/tests/enhancements/with-policy/cross-model-field-comparison.test.ts:
    • model Foo { ... }
    • model Bar { ... }
    • @@allow('all', bar.private && bar.user == auth())
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify that the `Foo` and `Bar` models are defined correctly and that the `private` field in the `Bar` model is utilized correctly.

# Search for model definitions in the codebase.
rg --type typescript $'model Foo {'
rg --type typescript $'model Bar {'

Length of output: 245



Script:

#!/bin/bash
# Description: Verify that the `Foo` and `Bar` models are defined correctly and that the `private` field in the `Bar` model is utilized correctly.

# Search for model definitions in the codebase using corrected regex patterns.
rg --type typescript 'model Foo \{'
rg --type typescript 'model Bar \{'

# Verify the usage of the `private` field in the `Bar` model.
rg --type typescript 'Bar.*private'

Length of output: 218



Script:

#!/bin/bash
# Description: Verify that the `Foo` and `Bar` models are defined correctly and that the `private` field in the `Bar` model is utilized correctly.

# Search for model definitions in the codebase using the correct file type.
rg --type ts 'model Foo \{'
rg --type ts 'model Bar \{'

# Verify the usage of the `private` field in the `Bar` model.
rg --type ts 'Bar.*private'

Length of output: 4589



Script:

#!/bin/bash
# Description: Verify the definition and usage of the `private` field in the `Bar` model.

# Search for the `private` field definition within the `Bar` model.
rg --type ts 'model Bar \{[^}]*private Boolean'

# Search for the usage of the `private` field in the codebase.
rg --type ts '\bprivate\b'

Length of output: 70930

README.md Show resolved Hide resolved
@ymc9 ymc9 added this pull request to the merge queue Jun 14, 2024
Merged via the queue into main with commit 0fa292c Jun 14, 2024
16 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.

1 participant