-
Notifications
You must be signed in to change notification settings - Fork 47
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
feat(server): get only what hasn't been deleted #1179
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
✅ Deploy Preview for reearth-web canceled.
|
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.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- server/internal/infrastructure/memory/project.go (1 hunks)
- server/internal/infrastructure/mongo/project.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (3)
server/internal/infrastructure/memory/project.go (1)
48-48
: LGTM! Verify consistency across implementations.The addition of
!d.IsDeleted()
to the condition effectively filters out deleted projects, aligning with the PR objective. This change improves the query's accuracy by returning only active projects.To ensure consistency, please verify that similar changes have been made in other storage implementations (e.g., MongoDB). Run the following script to check for consistency:
This script will help identify if the
IsDeleted()
check has been consistently implemented across different storage backends.server/internal/infrastructure/mongo/project.go (2)
87-88
: LGTM: Filter non-deleted projects as intended.The addition of
"deleted": false
to the filter aligns with the PR objective to query only non-deleted projects. This change improves the method's functionality and potentially its performance.
87-88
: Verify impact on other parts of the codebase.The change to filter out deleted projects by default might affect other parts of the codebase that expect all projects to be returned. It's important to verify that this change doesn't introduce unexpected behavior elsewhere.
To help identify potential issues, you can run the following script:
Please review the results to ensure that all usages of
FindByWorkspace
and handling of deleted projects are consistent with this change.✅ Verification successful
Verification Successful: No Impact Detected
The change to filter out deleted projects by default has been reviewed across the codebase. Existing methods like
FindDeletedByWorkspace
and corresponding tests ensure that handling of deleted projects remains consistent and unaffected by this default filter.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for usages of FindByWorkspace to identify potential impacts # Test: Search for FindByWorkspace method calls echo "Searching for FindByWorkspace method calls:" rg --type go "FindByWorkspace\(" -A 3 # Test: Search for any references to deleted projects echo "\nSearching for references to deleted projects:" rg --type go "deleted.*project" -iLength of output: 14394
Overview
Get only what hasn't been deleted
What I've done
Query projects only for non-deleted items
What I haven't done
How I tested
Which point I want you to review particularly
Memo
Summary by CodeRabbit