You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fan-out from umbrella to 4 plan types is implicit (planTypesForParams does it inside getSavingsPlansRecommendations) -- a reader scanning GetAllRecommendations doesn't see "this expands to 4 calls".
Scope (cosmetic-only, NO SQL migration)
Three changes, all in pkg/common/types.go + call sites:
RenameServiceSavingsPlans -> ServiceSavingsPlansAll. The string value stays "savingsplans" (DB column unchanged). Same for any test fixtures, frontend constants, etc. Goal: at every call site, the reader can tell at a glance "this is the umbrella sentinel, not a specific plan type".
Addfunc SavingsPlansPlanTypes() []ServiceType returning the 4 per-plan-type slugs in canonical order (Compute / EC2Instance / SageMaker / Database).
Update IsSavingsPlan to match the renamed identifier (no behaviour change).
Summary
The Savings Plans service-type slug system is confusing on first read:
Two sources of confusion:
savingsplansvssavings-plans-*) -- deliberate per issue Normalize 'savings-plans' vs 'savingsplans' identifier across frontend + backend cloud-commitments-platform#7 to avoid a SQL migration, but the Go identifierServiceSavingsPlansdoesn't signal that this one is a sentinel/umbrella.planTypesForParamsdoes it insidegetSavingsPlansRecommendations) -- a reader scanningGetAllRecommendationsdoesn't see "this expands to 4 calls".Scope (cosmetic-only, NO SQL migration)
Three changes, all in
pkg/common/types.go+ call sites:Rename
ServiceSavingsPlans->ServiceSavingsPlansAll. The string value stays"savingsplans"(DB column unchanged). Same for any test fixtures, frontend constants, etc. Goal: at every call site, the reader can tell at a glance "this is the umbrella sentinel, not a specific plan type".Add
func SavingsPlansPlanTypes() []ServiceTypereturning the 4 per-plan-type slugs in canonical order (Compute / EC2Instance / SageMaker / Database).Update
IsSavingsPlanto match the renamed identifier (no behaviour change).Out of scope
"savingsplans"-- explicitly avoided per issue Normalize 'savings-plans' vs 'savingsplans' identifier across frontend + backend cloud-commitments-platform#71 row -> 4 rowsmigration that isn't lossless and was rejected at Normalize 'savings-plans' vs 'savingsplans' identifier across frontend + backend cloud-commitments-platform#7"savings-plans"(hyphenated) mapper ininternal/purchase/execution.go-- that handles pre-#85 JSONB blobs and stays as-isAcceptance criteria
ServiceSavingsPlansrenamed toServiceSavingsPlansAllacross the Go codebaseSavingsPlansPlanTypes()helper added with a unit test asserting the 4-element canonical orderIsSavingsPlanstill recognises all 5 slugs (4 per-plan-type + 1 umbrella)"savingsplans")"savingsplans"for the umbrellaCross-references
"savingsplans"(no hyphen) as the canonical DB-column value to avoid migrationServiceSavingsPlanstoGetRecommendationsForServicewhich is exactly the call site that benefits most from the rename