Repository navigation
fix(sp): fetch only the Savings Plan types requested by --include/--exclude-sp-types - #2183
Conversation
…xclude-sp-types Each per-plan-type service queries exactly one plan type and the provider ignores IncludeSPTypes/ExcludeSPTypes for it, so the flags never narrowed the fetch. Filter the SP service list in determineServicesToProcess and reject unknown type names. Closes #2177 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 41 minutes for your next included review. View limit details
Comment |
|
Independent review (claude-opus-5-5) of df5f97b: APPROVE Root cause (confirmed against the pinned library)
Findings (none blocking)
Local verification (macOS, exact head)
CI is green on this SHA and the PR is mergeable. |
Closes #2177
Root cause
parseServicesexpandssavingsplansinto four per-type slugs. Each slug setsRecommendationParams.Serviceto one plan type, and the library'splanTypesForParamsreturns that single type as soon as the service is a per-type slug, soIncludeSPTypes/ExcludeSPTypes(cmd/multi_service_helpers.gofetchRecommendationsForRegion) are never consulted. The fix narrows the SP service list indetermineServicesToProcess(newfilterSavingsPlanTypes), so only requested types are fetched. Names match case-insensitively; an unknown name is an error rather than silently ignored. Non-SP services are untouched. No library change.Evidence
Regression test
TestDetermineServicesToProcess_SavingsPlanTypeFilters.go test ./...passes (1358);go vetclean.make lintcannot run locally (golangci-lint built with older Go than go.mod); CI is authoritative.Real data, dry run only,
--services savingsplans --include-sp-types EC2Instance ...: main printsProcessing services: Compute, EC2 Instance, SageMaker, Database Savings Plans; this branch printsProcessing services: EC2 Instance Savings Plansand queries only that type. (Recommendations themselves need #2176, which is a separate PR.)🤖 Generated with Claude Code