fix: 팀명 수정 시 앞뒤 공백 제거 누락 수정#61
Conversation
로컬 서버를 띄워 PATCH /api/v1/teams/{teamId}를 실제로 호출하며 QA하다가 발견 -
" 이름 " 처럼 앞뒤에 공백이 있는 teamName을 그대로 저장하고 있었다.
팀 생성 API(TeamCreateCommand)는 이미 Texts.trim()으로 teamName을 정리하는데
이번에 추가한 renameTeam()만 빠뜨렸다. 같은 유틸을 적용해 동작을 맞췄다.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 39 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough팀명 변경 시 입력 문자열의 양 끝 공백을 제거하도록 서비스 로직을 변경하고, 트리밍된 팀명과 응답을 검증하는 테스트를 추가했습니다. Changes팀명 변경 입력 정규화
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/test/java/com/shinhan/klljs/domain/team/service/TeamMemberManagementServiceTest.java`:
- Around line 125-135: Update renameTeam_trimsEdgeWhitespace to flush and clear
the persistence context after renaming, then reload the Team from the database
and assert the reloaded entity’s team name is trimmed. Keep the response
assertion and existing business-rule coverage unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 041421d2-cf8e-4b1e-a5b1-00c386c087c4
📒 Files selected for processing (2)
src/main/java/com/shinhan/klljs/domain/team/service/TeamMemberManagementService.javasrc/test/java/com/shinhan/klljs/domain/team/service/TeamMemberManagementServiceTest.java
CodeRabbit 지적 - 기존 테스트는 flush 없이 영속성 컨텍스트에 남아있는 같은 Team 인스턴스를 검사해서, 실제로 DB에 반영됐는지가 아니라 메모리 상태만 확인하고 있었다. flush+clear 후 다시 조회하도록 고쳤다 - 같은 파일의 leaveTeam_allowsSoleOwnerToLeaveWithoutTransfer 테스트와 동일한 패턴이다. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
PR #62에 합쳤습니다 (팀명 수정 공백 버그 수정 + 캠페인명 수정 API를 하나의 PR로 결합). 이 PR은 닫습니다. |
Summary
PR이 이미 첫 번째 커밋만으로 스쿼시 머지되어
dev에는 반영되지 않은 채 남아있었다.로컬 서버로 실제 API를 호출하며 QA하던 중 발견한 회귀 버그가
dev(및 배포됐다면 운영)에그대로 살아있던 것 — 이번 PR로 정정한다.
TeamMemberManagementService.renameTeam()이Texts.trim()없이teamName을 그대로저장하고 있었다. 팀 생성(
TeamCreateCommand)은 이미 같은 유틸로 trim하는데 rename만빠뜨렸던 것 —
" 이름 "처럼 앞뒤 공백이 있는 값을 그대로 저장하던 버그를 고쳤다.Test plan
renameTeam_trimsEdgeWhitespace회귀 테스트 추가🤖 Generated with Claude Code
Summary by CodeRabbit
버그 수정
테스트