Repository navigation
Conversation
|
Warning Review limit reached
More reviews will be available in 10 minutes and 27 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai review |
Rate Limit Exceeded
|
|
Verification note: the multi-SP-plan summary fix for #248 (join all SP service labels comma-separated in extractPlanInfo) already shipped on base via #131; this PR's diff is test-only (+60/-0, no production change, as the PR body states) and its new test passes against pre-PR code, so it is coverage rather than a regression guard. Two small suggestions: (1) retitle/reframe so #248 is not auto-closed on the premise of a fix this PR did not make (the fix predates it); (2) the assertion regex /Compute SP.*EC2 Instance SP.*SageMaker SP/ depends on Object.values() insertion order and is brittle - prefer asserting each label is present (order-independent) or sort serviceValues deterministically. Leaving for a human. |
|
@coderabbitai full review Generated by Claude Code |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Fetch PR `#824` details and diff
gh pr view 824 --repo LeanerCloud/CUDly --json title,body,files,state,labels,headRefName
echo "---FILES---"
gh pr diff 824 --repo LeanerCloud/CUDlyLength of output: 4759 🏁 Script executed: #!/bin/bash
# Check the existing two-SP test and surrounding context
rg -n "issue `#131`\|two.*SP\|savings-plans\|extractPlanInfo" frontend/src/__tests__/plans.test.ts | head -60
echo "===extractPlanInfo implementation==="
rg -n "extractPlanInfo" frontend/src/ -A 20 | head -80
echo "===Object.values usage in plans==="
rg -n "Object\.values\|Object\.entries\|Object\.keys" frontend/src/plans.ts 2>/dev/null | head -20
fd "plans.ts" frontend/src --exclude "__tests__" --exec cat {}Length of output: 72378
Review:
|
| # | Severity | Location | Issue |
|---|---|---|---|
| 1 | 🟡 Metadata | PR title/body | closes #248`` auto-closes; fix predates this PR |
| 2 | 🟡 Test quality | new test, line ~317 | Ordering regex couples to fixture insertion order; three toContain calls suffice |
| 3 | 🔵 Existing code | plans.ts Line 325 |
Unreachable serviceValues.length === 0 branch in extractPlanInfo |
The test structure (fixture shape, mock setup, comment block) is solid. Findings 1 and 2 echo what you already noted; I'd lean toward replacing the regex with a toContain of the full comma-joined string as the cleanest fix.
🧠 Learnings used
Learnt from: cristim
Repo: LeanerCloud/CUDly PR: 0
File: :0-0
Timestamp: 2026-05-05T15:44:54.463Z
Learning: In the LeanerCloud/CUDly repository, when a CodeRabbit review flags something as "outside-diff" that was already implemented in an earlier commit of the same PR, it is likely a stale-snapshot artifact where the review diff was generated against a pre-fix view. The inline comment convention `(CR pass on PR #<number> Finding N)` is used by the maintainer (cristim) to mark lines that were changed in direct response to a prior CodeRabbit review pass.
Learnt from: cristim
Repo: LeanerCloud/CUDly PR: 0
File: :0-0
Timestamp: 2026-06-06T06:43:53.792Z
Learning: In LeanerCloud/CUDly PR `#995` (issue `#950` ownership gate), the Dashboard "Upcoming purchases" widget (`dashboard.ts`) has two Cancel entry points (card-level and modal) that both call `api.deletePlannedPurchase`. The `UpcomingPurchase` response DTO must include `CreatedByUserID *string` (omitempty, mirroring `PlannedPurchase`) so the frontend can gate these buttons via a `canCancelUpcomingPurchase` helper that mirrors `canManageScheduledPurchase` on the Plans page. Without this, the backend correctly 403s non-owners but the UI has no gate and the UX is broken. Regressions: `frontend/src/__tests__/dashboard-ownership-950.test.ts` (6 tests) and `TestHandler_getUpcomingPurchases_PropagatesCreatedByUserID`. Fixed in commit 94326f6b9.
|
@coderabbitai full review |
✅ Action performedFull review finished. |
|
Closing as a no-op: the #248 multi-SP-plan-summary fix already shipped on base via #131 (extractPlanInfo joins all SP service labels). This PR is test-only, passes against pre-PR code, and includes a brittle Object.values()-order-dependent regex. 'closes #248' would be misleading. The added coverage can be re-proposed standalone with an order-independent assertion. |
Summary
extractPlanInfoalready joins all service labels; the existingissue #131test covered 2 SP types, this extends coverage to 3.Test plan
cd frontend && npx jest src/__tests__/plans.test.ts --no-coveragepasses (109 tests)cd frontend && npx tsc --noEmitcleancd frontend && npx jest --no-coveragepasses (2143 tests)