-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
chore: disallow this
in collection predicate
#1176
Conversation
WalkthroughWalkthroughThe modifications involve refining the validation and auto-completion functionalities in the language server and its testing framework. Specifically, these changes enhance the handling of collection predicates in expressions by introducing a dedicated validation method and adjusting the scope of auto-completion to improve the development experience. Additionally, the testing suite is expanded to cover new scenarios, ensuring the robustness of data model validations, particularly with the use of Changes
Related issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- packages/schema/src/language-server/validator/expression-validator.ts (3 hunks)
- packages/schema/tests/schema/validation/datamodel-validation.test.ts (1 hunks)
Additional comments: 3
packages/schema/src/language-server/validator/expression-validator.ts (2)
- 16-16: The addition of
streamAst
from 'langium' is appropriate for the functionalities introduced in this update. It's used effectively within thevalidateCollectionPredicate
method to search forthis
expressions within collection predicates.- 231-244: The
validateCollectionPredicate
method is well-implemented to enforce the new rule against usingthis
in collection predicates. It effectively searches forthis
expressions within the predicate and generates a clear error message if found. This addition aligns with the PR's objectives and enhances the validation logic.packages/schema/tests/schema/validation/datamodel-validation.test.ts (1)
- 81-102: The addition of the test for using
this
in collection predicates is well-crafted. It effectively verifies the new validation rule by expecting an error whenthis
is used in a collection predicate. Additionally, it includes a positive case that validates correct behavior whenthis
is not used, which is a good practice for comprehensive testing.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tests/integration/tests/regression/issues.test.ts (1 hunks)
Additional comments: 1
tests/integration/tests/regression/issues.test.ts (1)
- 603-603: The change from
auth() == this
toauth().id == id
in the access control logic appears to correctly refine the condition for checking user IDs within the same organization. However, it's crucial to verify this change in the broader context of the application to ensure it doesn't introduce any security issues or regressions.
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tests/integration/tests/regression/issue-925.test.ts (1 hunks)
Additional comments: 1
tests/integration/tests/regression/issue-925.test.ts (1)
- 38-39: Consider adding a comment above the disabled test case to explain why it was disabled. This helps maintain clarity and context for future developers or when revisiting this test case later.
Summary by CodeRabbit
this
.