fix(analytics): reject invalid KPI numeric evidence on current main - #421
fix(analytics): reject invalid KPI numeric evidence on current main#421seonghobae wants to merge 3 commits into
Conversation
|
Warning Review limit reached
Next review available in: 37 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughKPI ledger 파싱이 비율의 유한성 및 ChangesKPI ledger 검증
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java (1)
89-98: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win허용 경계값 테스트를 추가하세요.
현재 테스트는
0.5만 유효한 비율로 사용하고-0.01,1.01만 거부합니다.rate의 허용 범위는[0.0, 1.0]이므로0.0과1.0을 성공적으로 로드하는 사례를 추가하세요.KpiSnapshotResponse.from은p95TimeToPreviewMs를0L로 생성할 수 있으므로,0도 성공 사례로 확인하세요. 이 테스트가 없으면 경계 조건이 잘못되어도 회귀 테스트가 통과할 수 있습니다.🤖 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 `@src/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java` around lines 89 - 98, The rejectsNonFiniteOrOutOfRangePersistedKpiEvidence test currently lacks valid boundary cases. Add successful-load assertions covering rate values 0.0 and 1.0, plus p95TimeToPreviewMs equal to 0, using the existing valid-ledger assertion/helper flow.
🤖 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.
Nitpick comments:
In `@src/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java`:
- Around line 89-98: The rejectsNonFiniteOrOutOfRangePersistedKpiEvidence test
currently lacks valid boundary cases. Add successful-load assertions covering
rate values 0.0 and 1.0, plus p95TimeToPreviewMs equal to 0, using the existing
valid-ledger assertion/helper flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f190d4fb-dd21-4208-b2f8-37939bb89dee
📒 Files selected for processing (2)
src/main/java/com/clearfolio/viewer/analytics/KpiSnapshotLedger.javasrc/test/java/com/clearfolio/viewer/analytics/KpiSnapshotLedgerTest.java
Objective
Reconstruct #389's bounded KPI ledger numeric-integrity repair directly on current protected
mainafter #264 advanced the baseline, without stale ancestry.Test-first current-base state
b66b692ce580b783cddf9e99d96c4f94aa6b1735;6610529acb9b6bdf41c1f7d5d491dbf00fdfef7e;KpiSnapshotLedger.javaand its focused test were byte-identical to fix(analytics): reject invalid KPI numeric evidence #389's historical protected base before this reconstruction;NaN, positive/negative infinity, rates outside[0,1], and negative p95 preview latency to fail closed with the existing controlled invalid-line error.This Draft intentionally begins RED. Observe exact current-head CI failure before applying the narrow parse-boundary validation; then require exact-head Maven/100% coverage/Javadocs plus CI/Security/SAST/fuzz and fresh review/thread evidence.
Scope
Two-file analytics data-integrity slice only. It does not change KPI denominator semantics, tenant-query isolation, API shape, or canonical documentation. PR #389 remains the stale-base predecessor until this current-base reconstruction proves and preserves its unique semantic delta.
Summary by CodeRabbit
버그 수정
테스트