Refactor/#231 ClickAnomalyEvent, ClickBaselineStat 연관 삭제 보장 - #232
Conversation
…tory 메서드 추가" This reverts commit 9d237ab.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough조직 Hard Delete와 플랫폼 계정 정리 과정에 클릭 이상 이벤트 및 클릭 기준 통계 삭제를 추가했습니다. 저장소에 청크 삭제 쿼리를 정의하고, 삭제 참조 구조를 검증하는 JPA 테스트와 MySQL 테스트 설정을 추가했습니다. Changes클릭 데이터 삭제 정리
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The PR adds cleanup for click anomaly and baseline data when organizations or advertising-platform connections are removed; no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant PlatformServiceImpl
participant PlatformDataCleanupExecutor
participant ClickAnomalyEventRepository
participant ClickBaselineStatRepository
PlatformServiceImpl->>PlatformDataCleanupExecutor: 계정별 이상 이벤트 청크 삭제
PlatformDataCleanupExecutor->>ClickAnomalyEventRepository: deleteByPlatformAccountIdInBatch
ClickAnomalyEventRepository-->>PlatformDataCleanupExecutor: 삭제 건수 반환
PlatformServiceImpl->>PlatformDataCleanupExecutor: 계정별 기준 통계 청크 삭제
PlatformDataCleanupExecutor->>ClickBaselineStatRepository: deleteByPlatformAccountIdInBatch
ClickBaselineStatRepository-->>PlatformDataCleanupExecutor: 삭제 건수 반환
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 72.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 18 functions across 6 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
kingmingyu
left a comment
There was a problem hiding this comment.
P4: 고생하셨어요! 광고 계정 연동 해제 및 조직 Hard Delete 시 ClickAnomalyEvent, ClickBaselineStat이 함께 정리되도록 잘 반영된 것 같습니다..! 테스트 코드도 저는 있는게 좋다고 생각합니다! application-test.yml은 ci쪽 db 생성이랑 중복되는 것 같긴한데 로컬에서 테스트 돌리기 위해서는 필요해서 추가하는 것이 좋은 것 같아요!
📌 관련 이슈
🚀 개요
광고 플랫폼 연동 해제, 조직 삭제 시 연관된 ClickAnomalyEvent, ClickBaselineStat 이 함께 제거될 수 있도록 코드를 개선했습니다.
📄 작업 내용
📸 스크린샷 / 테스트 결과 (선택)
테스트 코드 통과 확인

✅ 체크리스트
🔍 리뷰 포인트 (Review Points)
만약 PK를 참조하는 엔티티가 추가된다면 해당 테스트로 확인한 뒤, OnDelete 나 서비스 로직에서 명시적으로 연관 삭제를 진행하게 하고, 테스트 코드에서 상수 부분을 추가해서 테스트가 통과되도록 수정하면 됩니다.
테스트용 application-test.yml 에서 로컬 DB 의 information_schema 만 SELECT 로 참조하도록 한거라 운영 DB 에 문제 없을 것 같은데 혹시라도 CI 가 실패하거나 문제점 발견되면 수정해보겠습니다..!!
Summary by CodeRabbit
개선 사항
테스트