fix(cli): log dropped recs from --min-pool-size filter (closes #359)#850
fix(cli): log dropped recs from --min-pool-size filter (closes #359)#850cristim wants to merge 2 commits into
Conversation
|
@coderabbitai review |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 46 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthrough
ChangesPool Size Filter Diagnostics
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
applyFilters now emits one INFO line per dropped rec: INFO: --min-pool-size=2.0 dropped rds/us-east-1/db.t3.micro (avg=0.80 < threshold) and a summary line after all drops are counted: INFO: --min-pool-size dropped N recommendation(s) (X avg instances/hr total) The pool-size check is lifted out of passesDimensionFilters and evaluated first in applyFilters so drops can be observed and counted without adding side effects to the pure shouldIncludePoolSize predicate. Adds TestShouldIncludePoolSize (5 cases) and TestApplyFilters_PoolSizeLogs to assert both the per-rec and summary log lines.
…fixes - Reject fractional and negative --min-pool-size values in validateNumericRanges (instance counts are integers; 1.5 is nonsensical as a threshold) - Add test cases for negative, fractional, zero, and whole-number inputs - Remove redundant shouldIncludePoolSize call from passesDimensionFilters; applyFilters already handles it with logging, so the silent re-check was dead code that obscured the observable path - Replace []string accumulator (poolDrops) with an int counter since labels are already logged per-rec and the summary only needs a count - Fix rangeValCopy: use index loop to avoid copying 360-byte Recommendation - Fix equalFold: use strings.EqualFold instead of ToLower+== in engine checks - Fix godot: add missing periods to exported comments in filters and validators
Summary
applyFiltersnow emits one INFO line per rec dropped by--min-pool-size:INFO: --min-pool-size=2.0 dropped rds/us-east-1/db.t3.micro (avg=0.80 < threshold)INFO: --min-pool-size dropped N recommendation(s) (X avg instances/hr total)shouldIncludePoolSizestays a pure predicate; the drop check is lifted out ofpassesDimensionFiltersintoapplyFiltersso it can be observed and counted.Test plan
go test ./cmd/ -run TestShouldIncludePoolSize-- 5 boundary casesgo test ./cmd/ -run TestApplyFilters_PoolSizeLogs-- asserts per-rec and summary log linesgo test ./cmd/-- full suite (730 tests) passesSummary by CodeRabbit
New Features
--min-pool-sizefiltering: detailed logs now show individual recommendations that are excluded and provide aggregated statistics on dropped items and their resource usage.Tests