feat(commitmentopts): probe Savings Plans offerings live (closes #108)#569
feat(commitmentopts): probe Savings Plans offerings live (closes #108)#569cristim wants to merge 1 commit into
Conversation
Add SavingsPlansProber that calls DescribeSavingsPlansOfferings once per plan type (Compute, EC2Instance, SageMaker, Database) and emits per-product service keys aligned with SERVICE_FIELDS in settings.ts: savings-plans-compute / savings-plans-ec2instance / savings-plans-sagemaker / savings-plans-database The prober reuses walkPaginated (page cap, token threading) and the shared normalizePayment/durationToTerm normalizers. Duplicate (duration, payment) pairs within one plan type are collapsed via dedupeRaw before collect so ProductType variants in the SP API response don't inflate the combo count. Empty plan types return zero combos and are silently dropped so the frontend falls back to its hardcoded rules for that key rather than treating an empty DB row as "probed and nothing valid". SavingsPlansProber is registered in DefaultProbers alongside the six RI probers. Service.probeAndPersist fans it out concurrently; the all-or-nothing abort-on-error contract is inherited. Unit tests cover: standard combos, all four plan types, empty-result drop, error propagation, page cap, dedup across ProductType variants.
|
Warning Review limit reached
Your plan currently allows 2 reviews/hour. Refill in 21 minutes and 49 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, 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 trial, open-source, and free plans. In all cases, review capacity refills continuously over time. 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)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
SavingsPlansProberthat callsDescribeSavingsPlansOfferingsonce per plan type (Compute, EC2Instance, SageMaker, Database) and emits per-product service keys aligned withSERVICE_FIELDSinsettings.tswalkPaginated,normalizePayment, anddurationToTermfrom the existing RI probe infrastructurededupeRawto collapse duplicate(duration, payment)pairs that arise because the SP API returns one row per ProductType (EC2/Lambda/Fargate) within a plan typeSavingsPlansProberinDefaultProbers()alongside the six RI probersTest plan
go test ./internal/commitmentopts/...passes (66 tests including 8 new SP prober tests)go test ./internal/api/... -shortpasses (1151 tests)Closes #108