-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor/user auth type #181
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
|
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration 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.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/user/UserAuthTypeRepositoryImpl.java (2)
31-33: 반환 리스트의 변경 가능성(immutability) 일관화 제안현재
getUserAuthType(User)는stream().toList()로 읽기 전용 리스트를 반환하지만, 변경된getUserAuthTypesByUser(User)는 JPA가 반환한 리스트(가변) 그대로를 돌려줍니다. 두 메서드의 반환 리스트 변경 가능성이 달라 혼선을 줄 수 있습니다. 일관성을 위해 읽기 전용으로 감싸는 것을 권장합니다.아래처럼 한 줄만 변경하면 됩니다(Null 반환 가능성이 없다면 안전합니다. 만약 null 가능성이 있다면 코멘트로 알려주세요.
List.of()로 대체 가능하도록 제안 드리겠습니다).- return userAuthTypeJpaRepository.findUserAuthTypeByUser(user); + return List.copyOf(userAuthTypeJpaRepository.findUserAuthTypeByUser(user));
26-27: 중복 AuthType 방지 필요 시.distinct()적용 검토동일 유저가 동일
AuthType을 중복으로 가질 가능성을 데이터 제약으로 막지 않는다면,List<AuthType>결과에서 중복을 제거하는 편이 안전합니다. 성능 측면에서는 JPA Projection으로AuthType만 select 하는 방법도 고려해주세요.- return userAuthTypeJpaRepository.findUserAuthTypeByUser(user).stream() - .map(UserAuthType::getAuthType).toList(); + return userAuthTypeJpaRepository.findUserAuthTypeByUser(user).stream() + .map(UserAuthType::getAuthType) + .distinct() + .toList();참고: Projection 적용 시에는
UserAuthTypeJpaRepository에@Query또는 인터페이스 기반 프로젝션을 추가하는 방식이 적합합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/main/java/org/ezcode/codetest/infrastructure/persistence/repository/user/UserAuthTypeRepositoryImpl.java(1 hunks)
⏰ 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: build
작업 내용
변경 사항
UserService.createUser()메서드 추가@Email유효성 검증 적용트러블 슈팅
@Transactional이 적용되지 않음this.→AopProxyUtils.사용)해결해야 할 문제
UserController에서 비즈니스 로직 일부 처리 → 서비스로 이전 고려 필요참고 사항
코드 리뷰 전 확인 체크리스트
type :)Summary by CodeRabbit