Repository navigation
fix(gcp/computeengine): report monthly CUD cost as recurring, not upfront - #385
Conversation
…ront CommitmentCost is the upfront payment and is 0 for a monthly commitment; the committed price goes to RecurringMonthlyCost. The platform adds upfront plus monthly x term, so the term total in CommitmentCost was counted twice. BreakEvenMonths is dropped: with no upfront payment there is none. Closes #383 Refs platform#683 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
…te-monthly-cost-semantics
|
Independent review (claude-opus-5-5) of 2112144: CHANGES REQUESTED Reviewed head 2112144 (0fcebc2 plus a merge of go#381's 1a25519). The Blocking
Non-blocking Evidence
|
What
Align Compute Engine CUD cost fields with the shared semantics (
CommitmentCost= upfront, 0 for monthly or no-upfront;RecurringMonthlyCost= USD per month). Before, a monthly rec hadCommitmentCost= the term total andRecurringMonthlyCost= total / months.The platform currently computes upfront + monthly x term (platform
scheduler.go:1650), so the old output was counted about 2x. This PR removes that overcount. platform#683: please confirm for the platform owner that no other consumer relies onCommitmentCostbeing the term total for GCP.enrichRecWithPricingsetsRecurringMonthlyCost= committed term total / months and leavesCommitmentCost0. A pricing failure leavesRecurringMonthlyCostnil (unknown), not 0.BreakEvenMonthsis no longer computed here: with no upfront payment it is undefined, and the old value treated the whole term cost as sunk.OnDemandCostis unchanged (on-demand price over the term).monthlypayment option stays.Stacked on go#381
This branch contains the go#381 commits (pricing); merge #381 first, then this one rebases cleanly onto main. Only the last commit is new.
Fail before, pass after
TestConverterFillsPricingForScorer(4 vCPU, 6 GiB, live-shaped N1 1-year SKUs) on the pre-change code:After: passes, with
RecurringMonthlyCost= (4 x 0.019915 + 6 x 0.002669) x 8760 / 12 = 69.84 USD/month.go test ./...inproviders/gcppasses.Closes #383
Refs platform#683
🤖 Generated with Claude Code