-
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
chore(server): refactoring id project and workspace [VIZ-BE-574] #1426
base: main
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@hexaforce has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 36 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (107)
WalkthroughThis pull request refactors multiple type declarations and method signatures across various packages. The changes update identifiers for projects and workspaces to use more explicit types from the Changes
Sequence Diagram(s)(No sequence diagrams applicable for these type and signature refinements.) Possibly related PRs
Suggested reviewers
Poem
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.
|
3b20fa5
to
d736d7f
Compare
server/pkg/asset/id.go
Outdated
@@ -6,7 +6,8 @@ import ( | |||
) | |||
|
|||
type ID = id.AssetID | |||
type WorkspaceID = accountdomain.WorkspaceID | |||
|
|||
// type WorkspaceID = accountdomain.WorkspaceID |
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.
@hexaforce
if this line isn't needed, could you delete this 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.
ok. fixed
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.
@hexaforce
I have a comment!
Could you confirm it?
But LGTM!
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: 0
🧹 Nitpick comments (1)
server/internal/usecase/operator.go (1)
49-49
: Fix typo in method name.The method name should be pluralized for consistency with other methods.
-func (o *Operator) AllMaintainingWorkspace() accountdomain.WorkspaceIDList { +func (o *Operator) AllMaintainingWorkspaces() accountdomain.WorkspaceIDList {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
server/internal/infrastructure/memory/scene.go
(1 hunks)server/internal/infrastructure/mongo/container.go
(2 hunks)server/internal/infrastructure/mongo/scene.go
(1 hunks)server/internal/usecase/operator.go
(1 hunks)server/internal/usecase/repo/container_test.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Redirect rules - reearth-web
- GitHub Check: Header rules - reearth-web
- GitHub Check: Pages changed - reearth-web
- GitHub Check: ci-server / ci-server-lint
- GitHub Check: ci-server / ci-server-test
🔇 Additional comments (6)
server/internal/usecase/repo/container_test.go (1)
25-28
: LGTM! Test coverage looks comprehensive.The changes correctly standardize on
accountdomain.WorkspaceIDList
while maintaining thorough test coverage for workspace filter merging, including edge cases with empty lists.server/internal/infrastructure/memory/scene.go (1)
88-88
: LGTM! Clean transition to accountdomain package.The change correctly uses
accountdomain.WorkspaceIDList
while maintaining the existing thread-safe implementation and error handling.server/internal/infrastructure/mongo/scene.go (1)
77-77
: LGTM! MongoDB query updated correctly.The change appropriately uses
accountdomain.WorkspaceIDList
while maintaining the correct MongoDB query structure and error handling.server/internal/usecase/operator.go (1)
41-54
: LGTM! Return types updated consistently.The changes correctly standardize on
accountdomain.WorkspaceIDList
across all workspace-related methods.server/internal/infrastructure/mongo/container.go (2)
15-15
: LGTM! Import statement updated to use consolidated package.The change aligns with the PR objective of unifying ID definitions by using the consolidated
accountdomain
package instead of the specificuser
subpackage.
137-137
: LGTM! Function signature updated to use consolidated type.The parameter type change from
user.WorkspaceIDList
toaccountdomain.WorkspaceIDList
aligns with the PR objective of unifying workspace ID definitions. The function logic remains unchanged, ensuring backward compatibility.
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.
Reviewed 14 of 15 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @soneda-yuya)
08a69aa
to
3657355
Compare
8d1ed59
to
90d517d
Compare
90d517d
to
981ce22
Compare
Overview
Refactoring ids
What I've done
This pull request unifies the project and workspace IDs to the ones in ./server/pkg/id/id.go.
I removed the parts that were redefining the ID from id.go.
What I haven't done
How I tested
Which point I want you to review particularly
Memo
Each package has its own id.go.
Ideal Refactoring
Ideally, we should keep only ./server/pkg/id/id.go and remove the id.go files in each package.
Summary by CodeRabbit
Summary by CodeRabbit
These internal improvements streamline the system’s foundations without affecting end-user functionality.
This change is