docs(schema): document recommendations cloud_account_id filter semantics + add tests#236
Conversation
…ics + add tests (closes #211) Add inline comment tables at the two code sites that implement the account_ids → cloud_account_id SQL filter: - internal/config/store_postgres_recommendations.go::buildRecommendationFilter documents the four SQL-layer cases (absent/NULL/match/no-match) and calls out the NULL = ANY(array) → NULL PostgreSQL semantic that silently excludes legacy ambient rows. - internal/api/handler_recommendations.go::getRecommendations documents all five cases including the disabled-account case, which is enforced by the session-layer filterRecommendationsByAllowedAccounts (not the SQL filter), so future maintainers understand the two-layer design. Add TestGetRecommendations_AccountIDFilter (6 subtests) in handler_recommendations_test.go to pin each filter-case contract end-to-end via the handler mock. No production logic changed.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 0/5 reviews remaining, refill in 2 minutes and 33 seconds. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
account_ids→cloud_account_idSQL filter, documenting all five filter cases from the issue docs(schema): document recommendations cloud_account_id filter semantics + add tests #211 acceptance criteria.TestGetRecommendations_AccountIDFilter(6 subtests) inhandler_recommendations_test.goto pin each case end-to-end.Quirk surfaced
The fifth case (disabled-account exclusion) is enforced by the session-layer
filterRecommendationsByAllowedAccountsafter the SQL filter, not by SQL. The comment tables document this explicitly.Test plan
go test ./internal/api/... -run TestGetRecommendations_AccountIDFilter -v— 7 subtests passgo test ./internal/api/... -count=1— 1016 tests passgo test ./internal/config/... -count=1— 476 tests passCloses #211