-
Notifications
You must be signed in to change notification settings - Fork 55
fix relationship top level filter #715
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
* updated the tests
WalkthroughAdds conditional post-processing in Database::decode to handle nested relationship selections by caching transformed attribute values and restoring non-requested non-relationship fields when relationships are partially selected. Introduces comprehensive tests covering selective decoding with relationships, without relationships, and with multiple filters. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant DB as Database::decode
participant F as Filters
participant R as Relationship Logic
Client->>DB: decode(document, selection)
DB->>F: apply attribute filters
DB->>DB: cache transformed values (filteredValue)
alt selection includes relationships
DB->>R: process relationship selections
DB->>DB: post-process non-relationship fields using filteredValue
else
DB->>DB: standard decode (no relationship post-processing)
end
DB-->>Client: decoded document
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/Database/Database.php(3 hunks)tests/e2e/Adapter/Scopes/DocumentTests.php(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/Database/Database.php (1)
src/Database/Document.php (2)
getAttribute(224-231)setAttribute(244-261)
tests/e2e/Adapter/Scopes/DocumentTests.php (5)
src/Database/Database.php (3)
addFilter(6659-6665)createAttribute(1692-1747)Database(37-7355)src/Database/Adapter.php (3)
getSupportForRelationships(993-993)getSupportForSpatialAttributes(1058-1058)createAttribute(558-558)src/Database/Adapter/SQL.php (3)
getSupportForRelationships(1470-1473)getSupportForSpatialAttributes(1490-1493)createAttribute(234-248)src/Database/Adapter/Postgres.php (2)
getSupportForSpatialAttributes(1949-1952)createAttribute(444-463)src/Database/Query.php (2)
Query(8-1075)select(576-579)
🪛 PHPMD (2.15.0)
tests/e2e/Adapter/Scopes/DocumentTests.php
6100-6100: Avoid unused local variables such as '$createdStore'. (undefined)
(UnusedLocalVariable)
6239-6239: Avoid unused local variables such as '$created'. (undefined)
(UnusedLocalVariable)
6322-6322: Avoid unused local variables such as '$created'. (undefined)
(UnusedLocalVariable)
⏰ 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). (1)
- GitHub Check: Setup & Build Docker Image
Previously, Selecting attributes in a relationship didn't set decoded values in the top-level collection of the the final document in getDocument and find
Currently, its setting the filtered values to top-level collection if required
Summary by CodeRabbit
Bug Fixes
Tests