fix(aws): adopt the go expiry lookback credit so --target-coverage stops re-buying replacement RIs #2235
Copy link
Copy link
Closed
Labels
effort/sHoursHoursimpact/fewLimited audienceLimited audiencepriority/p1Next up; this sprintNext up; this sprintseverity/highSignificant harmSignificant harmtriagedItem has been triagedItem has been triagedtype/bugDefectDefecturgency/this-sprintWithin the current sprintWithin the current sprint
Description
Summary
LeanerCloud/cloud-commitments-go#449 (fixes go#346) adds recommendations.AdjustExistingCoverageForExpiringCommitmentsWithCoverageOptions. On the EC2 per-pool expiry path, it credits replacement RIs bought inside the Cost Explorer coverage lookback, so a re-run no longer recommends buying them again. The existing AdjustExistingCoverageForExpiringCommitmentsWithCoverage behaves exactly as before, with no credit.
Needed here
cmd/multi_service_helpers.go:540calls the old function.- After bumping the
providers/awspin to a version that contains go#449, call the new function instead. - Pass
PoolExpiryOptions{WindowDays: cfg.RebuyWindowDays, CoverageLookbackDays: <the same lookbackDays given to the coverage fetch>}. - Until then,
--target-coverageruns can still re-buy replacements purchased within the coverage lookback.
Test
A fixture with expiring RIs, and replacements bought N days ago inside the lookback, produces no replacement purchase.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
effort/sHoursHoursimpact/fewLimited audienceLimited audiencepriority/p1Next up; this sprintNext up; this sprintseverity/highSignificant harmSignificant harmtriagedItem has been triagedItem has been triagedtype/bugDefectDefecturgency/this-sprintWithin the current sprintWithin the current sprint
Activity
cristim commentedon Oct 17, 2026
Triaged and claiming [claude-cli-impl]: p1, because a --target-coverage run can re-buy replacement RIs bought within the coverage lookback, which spends money twice. go#449 is merged (512e42fe). This starts once #2256 merges, since both touch cmd/multi_service_helpers.go. It will bump the providers/aws pin to a version containing go#449 and switch the call at multi_service_helpers.go:~540.
cristim commentedon Oct 19, 2026
Taking over: no live owner since 2026-10-17 and #2256 has merged; finishing the existing uncommitted draft in its worktree [claude-cc-libs]
fix(aws): credit replacement RIs bought inside the coverage lookback (#…