Repository navigation
feat(reshape): surface staleness banner when Cost Explorer cache is old - #576
Conversation
|
Warning Review limit reached
More reviews will be available in 59 minutes and 50 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 (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
…ld (closes #150) The reshape-recommendations page silently showed alternatives sourced from a potentially-hours-old Cost Explorer cache with no freshness signal. This adds a backend staleness classifier and a frontend banner to warn users when the underlying data is stale. Backend: - classifyRecsAge maps an age duration to "" / "soft" / "hard" using 12 h and 24 h thresholds (mirrors dashboard freshness rule). - getReshapeRecommendations calls GetRecommendationsFreshness (already on StoreInterface) and populates recs_staleness + recs_collected_at on ReshapeRecommendationsResponse; freshness failures are non-fatal (logged, response ships without staleness metadata). - getReshapeRecommendations returns the same recs in all cases so no existing behaviour changes for the reshape table itself. Frontend: - getReshapeRecommendations now returns ReshapeRecommendationsResponse instead of a bare array; existing callers updated. - renderReshapeStalenessBanner inserts a banner slot immediately before the recommendations table with "warning" / "error" CSS classes and a relative-time age label. - Test mocks updated to the new response shape; banner unit tests added.
a027e4d to
106d4ef
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary
getReshapeRecommendationsnow readsGetRecommendationsFreshnessand populatesrecs_staleness(""/"soft"/"hard") andrecs_collected_aton the response; freshness failures are non-fatal (logged, staleness fields omitted)loadReshapeRecommendationscalls the newrenderReshapeStalenessBannerwhich inserts a banner slot above the recommendations table usingwarning/errorCSS classes with a relative-time age labelclassifyRecsAgeunit tests pin the 12h/24h thresholds; frontend banner snapshot tests cover all three staleness statesCloses #150
Test plan
go test ./internal/api/...passescd frontend && npx jest riexchangepasses (37 tests)cd frontend && npx tsc --noEmitpasses