fix(recommendations/aws): incorrect Effective Savings % — plumb on_demand_cost like Azure (#277) · Issue #303 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

fix(recommendations/aws): incorrect Effective Savings % — plumb on_demand_cost like Azure (#277) #303

Closed

Description

@cristim

Summary

The Effective Savings % shown for AWS recommendations is incorrect — it does not match the savings the customer would actually realize given the recommended commitment.

Observed

AWS recommendations show an Effective Savings % that diverges from the savings reconstructable from monthly_cost, recommended_monthly_cost, and on_demand_cost. This was previously fixed for Azure 1y RIs in #277 by plumbing on_demand_cost from the provider through to the frontend, but the AWS side still reports values that are wrong relative to the actual savings.

Expected

Effective Savings % = (on_demand_cost − recommended_monthly_cost) / on_demand_cost, using the canonical on_demand_cost returned by the provider — not a value reconstructed from current spend (which already includes existing commitments).

Acceptance criteria

  • AWS recommendations carry a non-null on_demand_cost from the provider all the way to RecommendationRecord and the API payload.
  • effectiveSavingsPct() in frontend/src/recommendations.ts resolves to the same value as the underlying provider report for AWS RIs and Savings Plans.
  • Unit test in frontend/src/__tests__/recommendations.test.ts pinning the expected effective % for at least one AWS RI fixture and one SP fixture.
  • Regression test in the AWS provider mapping that asserts OnDemandCost is populated.

Out of scope

Azure / GCP — Azure was fixed in #277; GCP needs a separate audit if the same bug shape applies.

Activity

  1. added a commit that references this issue on May 5, 2026
    c94c44a
  2. cristim commented on May 13, 2026

    @cristim
    MemberAuthor

    Verified resolved by PR #312 (merged 2026-05-05).

    Evidence from the diff:

    All four acceptance criteria from the issue body are satisfied. Recommending closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions