fix(cli): reject Count=0 and negative EstimatedSavings in CSV input #2116
Copy link
Copy link
Open
Labels
effort/xsTrivial / one-linerTrivial / one-linerimpact/fewLimited audienceLimited audiencepriority/p2Backlog-worthyBacklog-worthyseverity/mediumModerate harmModerate harmtriagedItem has been triagedItem has been triagedtype/bugDefectDefecturgency/this-quarterWithin the quarterWithin the quarter
Description
Activity
- addedpriority/p2Backlog-worthyBacklog-worthyeffort/xsTrivial / one-linerTrivial / one-linertype/bugDefectDefect
on Sep 28, 2026 claimed by cc-cli-w2 (bundling with #1327, same file cmd/multi_service_csv.go, per-issue commits)
- addedtriagedItem has been triagedItem has been triagedseverity/mediumModerate harmModerate harmurgency/this-quarterWithin the quarterWithin the quarterimpact/fewLimited audienceLimited audience
on Oct 7, 2026
Metadata
Metadata
Assignees
Labels
effort/xsTrivial / one-linerTrivial / one-linerimpact/fewLimited audienceLimited audiencepriority/p2Backlog-worthyBacklog-worthyseverity/mediumModerate harmModerate harmtriagedItem has been triagedItem has been triagedtype/bugDefectDefecturgency/this-quarterWithin the quarterWithin the quarter
From the review of #2114 (closes #1944). cmd/multi_service_csv.go ~185 still accepts an explicit Count of 0: it buys nothing but triggers a live purchase call ('About to buy 0 instances') that only AWS rejects (there's a provider zero guard for EC2 only). Change the check to n < 1 ('must be at least 1') and add a zero case to TestLoadRecommendationsFromCSV_StrictCount. The tool's own CSVs never emit 0 (the SP client sets Count: 1). Also reject a negative EstimatedSavings (~201), and stop printing the bad value twice in parse errors (%q plus a wrapped strconv.NumError, ~182/199).