fix: 릴리즈 리뷰 반영 — 시드 스냅샷 삭제 범위·검색어 길이 코드 포인트 기준 - #257
Conversation
CodeRabbit 릴리즈 리뷰 2건 반영. - seedSearchEvents: 스냅샷 전량 deleteMany가 시드와 무관한 기존 스냅샷까지 지움 → 시드가 쓰는 두 정각(직전·현재)만 삭제 후 재삽입(시드는 자기 영역만 정리한다는 idempotent 원칙 준수). - normalizeSearchKeyword: 길이 검사를 UTF-16 단위(.length)에서 코드 포인트 기준으로 — MySQL VarChar(200)은 문자 수 기준이라 서로게이트 쌍(이모지)이 2로 계산되면 저장 가능한 검색어를 거절함. 회귀 테스트(이모지 200/201개) 추가.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
🧹 knip — dead-code 리포트전체 리포트
|
🩺 NestJS Doctor — 90/100 (Excellent)진단 288건 (error 0).
architecture / security 상위 항목
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac38b09692
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await prisma.searchKeywordRankSnapshot.deleteMany({ | ||
| where: { ranked_at: { in: [previousAt, rankedAt] } }, | ||
| }); |
There was a problem hiding this comment.
Clean up snapshots from earlier seed runs
When the seed is rerun after the clock advances by more than one hour, snapshots created by the previous run fall outside these two timestamps and are never removed. resetSeedScope removes the corresponding seeded search events, while the snapshot table has unlimited retention, so repeated seed runs accumulate orphaned synthetic ranking history and the seed is no longer idempotent across hour boundaries; track and delete prior seed-owned snapshots rather than limiting cleanup solely to the new run's timestamps.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
미반영(트레이드오프): 스냅샷 소유권 추적은 컬럼 신설이 필요한 dev 시드 과설계. 크론이 시드 이벤트를 집계해 만든 스냅샷도 동일하게 잔존하므로 완전한 멱등은 어차피 불가. popularSearchKeywords는 최신 스냅샷만 노출하므로 과거 정각의 잔존 스냅샷은 화면에 나타나지 않고, 두 정각 한정 삭제로 같은 시간대 재시드의 중복(uk 충돌)은 방지됨.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Coverage report
Test suite run success1774 tests passing in 207 suites. Report generated by 🧪jest coverage report action from ac38b09 |
릴리즈 PR #255 CodeRabbit 지적 2건 반영: ① 시드의 스냅샷 deleteMany를 시드가 쓰는 두 정각으로 한정(무관 데이터 보존) ② 검색어 길이 검사를 코드 포인트 기준으로(VarChar(200) 문자 수와 일치, 이모지 회귀 테스트).