feat: 키워드 검색 집계 추가#102
Conversation
|
Warning Review limit reached
More reviews will be available in 32 minutes and 27 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough키워드 검색 요청에서 검색어 사용량을 별도 트랜잭션으로 증가시키는 경로가 추가되었습니다. 이를 위해 키워드 카운트 테이블, JPA 엔티티/리포지토리, 저장소 어댑터, 서비스 계층과 로컬 SQL 초기화 설정이 함께 변경되었습니다. Changes키워드 카운트 기록
Sequence Diagram(s)sequenceDiagram
participant LockerKeywordQueryService
participant KeywordCountCommandService
participant KeywordCountStoreAdapter
participant KeywordCountRepository
participant keyword_counts
participant LockerSearchQueryService
LockerKeywordQueryService->>KeywordCountCommandService: increase(keyword)
KeywordCountCommandService->>KeywordCountStoreAdapter: increase(normalizedKeyword)
KeywordCountStoreAdapter->>KeywordCountRepository: increase(keyword)
KeywordCountRepository->>keyword_counts: upsert search_count
LockerKeywordQueryService->>LockerSearchQueryService: getKeywordResults(...)
Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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
🧹 Nitpick comments (1)
scripts/db/03-keyword-counts.sql (1)
8-9: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win중복 인덱스 제거
UNIQUE (keyword)가 이미keyword용 인덱스를 생성하므로,CREATE INDEX는 중복입니다. 제거하세요.🤖 Prompt for 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. In `@scripts/db/03-keyword-counts.sql` around lines 8 - 9, The CREATE INDEX on keyword_counts.keyword is redundant because the UNIQUE constraint already creates an index for that column. Remove the extra index definition from the SQL migration, keeping only the UNIQUE (keyword) constraint so the keyword_counts table is indexed once through the existing unique key.
🤖 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/main/java/com/zimdugo/locker/application/keyword/LockerKeywordQueryService.java`:
- Around line 156-162: The keyword count update in increaseKeywordCount only
catches DataAccessException, so failures from the REQUIRES_NEW commit path can
still escape and break the search flow. Update
LockerKeywordQueryService.increaseKeywordCount to also handle
TransactionException alongside DataAccessException, and keep the warning log
path unchanged so keyword aggregation failures remain non-fatal.
---
Nitpick comments:
In `@scripts/db/03-keyword-counts.sql`:
- Around line 8-9: The CREATE INDEX on keyword_counts.keyword is redundant
because the UNIQUE constraint already creates an index for that column. Remove
the extra index definition from the SQL migration, keeping only the UNIQUE
(keyword) constraint so the keyword_counts table is indexed once through the
existing unique key.
🪄 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: CHILL
Plan: Pro
Run ID: 13be7248-d0ec-4c77-b166-f9ec28786d71
📒 Files selected for processing (8)
scripts/db/03-keyword-counts.sqlsrc/main/java/com/zimdugo/locker/application/keyword/KeywordCountCommandService.javasrc/main/java/com/zimdugo/locker/application/keyword/LockerKeywordQueryService.javasrc/main/java/com/zimdugo/locker/domain/keyword/KeywordCountStore.javasrc/main/java/com/zimdugo/locker/infrastructure/adapter/KeywordCountStoreAdapter.javasrc/main/java/com/zimdugo/locker/infrastructure/persistence/KeywordCountEntity.javasrc/main/java/com/zimdugo/locker/infrastructure/persistence/KeywordCountRepository.javasrc/main/resources/application-local.yaml
✨ 작업 내용 한 줄 요약
/lockers/keyword검색 시 키워드 검색 횟수를 누적 집계하는 기능을 추가했습니다.🛠️ 작업 내용
KeywordCount집계용 Entity 및 Repository 추가KeywordCountCommandService추가/lockers/keyword조회 시 키워드 검색 횟수 집계 로직 추가ON CONFLICT기반 upsert 방식으로 검색 횟수 누적keyword_counts스키마(SQL) 추가🧠 기술적 의사결정
ON CONFLICT기반 upsert를 사용했습니다.ddl-auto: validate를 사용하므로, 신규 테이블은 별도 SQL 스키마로 관리하도록 구성했습니다.📚 참고 자료 (선택)
📷 스크린샷 (선택)
Summary by CodeRabbit
새 기능
버그 수정
기타