-
Notifications
You must be signed in to change notification settings - Fork 0
Code Review Bench PR #30339 - feat: get plan bulk with cache #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_30339_20260125_4193
Are you sure you want to change the base?
Code Review Bench PR #30339 - feat: get plan bulk with cache #10
Conversation
| logger.exception( | ||
| "get_plan_bulk: failed to validate subscription plan for tenant(%s)", tenant_id | ||
| ) | ||
| results[tenant_id] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚠️ Bug: get_plan_bulk sets None instead of skipping invalid tenants
On line 292, when validation fails for a tenant's plan data, the code sets results[tenant_id] = None. This contradicts the intended behavior (skip invalid tenants) and has two downstream consequences:
-
Test failure: The unit test
test_get_plan_bulk_with_invalid_tenant_plan_skippedasserts"tenant-invalid" not in resultandlen(result) == 2, but the code adds the invalid tenant with valueNone, solen(result)will be 3 and the assertion will fail. -
Type violation:
get_plan_bulkis typed as returningdict[str, SubscriptionPlan], but it returnsNonevalues. This propagates intoget_plan_bulk_with_cachewhich will addNonetotenant_plans, cache"null"in Redis (viajson.dumps(None)), and on the next cache read,validate_python(None)will fail, causing a perpetual miss-refetch-cache cycle for that tenant.
The fix is to use continue instead of assigning None.
Was this helpful? React with 👍 / 👎
| results[tenant_id] = None | |
| except Exception: | |
| logger.exception( | |
| "get_plan_bulk: failed to validate subscription plan for tenant(%s)", tenant_id | |
| ) | |
| continue |
- Apply suggested fix
Code Review
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
Code Review Bench PR langgenius#30339 - feat: get plan bulk with cache
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#10
feat: get plan bulk with cache
Summary by Gitar
get_plan_bulk_with_cache()inapi/services/billing_service.pywith Redis backend and 10-minute TTLmget/pipeline) to minimize Redis round-tripsget_plan_bulk()instead of returningNoneThis will update automatically on new commits.