Conversation
Summary of ChangesHello @hwbrzzl, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the ORM's global scope management by introducing a mechanism to selectively disable global scopes. This provides developers with greater flexibility to control query behavior, allowing them to bypass default constraints when necessary, thereby improving the adaptability of the ORM for diverse data retrieval scenarios. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1335 +/- ##
=======================================
Coverage 70.05% 70.05%
=======================================
Files 281 281
Lines 16767 16767
=======================================
Hits 11746 11746
Misses 4530 4530
Partials 491 491 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces the WithoutGlobalScopes feature, allowing users to disable global scopes on ORM queries. The implementation is solid, involving a change to how global scopes are defined (from a slice to a named map) and updating the query builder to handle scope exclusion. The changes are well-tested, covering both the new functionality and its impact on existing methods.
My review includes a few suggestions to improve robustness and test reliability:
- Preventing duplicate entries when disabling scopes multiple times.
- Refactoring duplicated test setup code for better maintainability.
- Adding
OrderByclauses to several tests to prevent flakiness by ensuring a deterministic order of results.
Overall, this is a great addition to the framework. The change from an anonymous slice of scopes to a named map is a significant but necessary improvement for this feature.
|
|
||
| var globalScopes []func(contractsorm.Query) contractsorm.Query | ||
|
|
||
| names := slices.Sorted(maps.Keys(nameToGlobalScopes)) |
There was a problem hiding this comment.
Sort it to avoid test failure.
📑 Description
Closes goravel/goravel#833
✅ Checks