Skip to content

feat(recs): plumb provider SavingsPercentage to GUI (CLI/GUI parity; AWS missing on_demand_cost shows '—') #1106

Closed

Description

@cristim

Gap

The CLI/reporter shows AWS's authoritative rec.SavingsPercentage directly (internal/reporter/reporter.go:45, sourced from AWS EstimatedMonthlySavingsPercentage in parser_ri.go; the Azure and GCP converters also set SavingsPercentage). But SavingsPercentage is dropped at the API boundary -- it was never on config.RecommendationRecord, so it is never serialized to the frontend.

Because of that, the GUI re-derives the effective savings % client-side via effectiveSavingsPct(savings, on_demand_cost, ...). That recomputation:

  1. can drift from the provider's authoritative number, and
  2. returns null / "—" when on_demand_cost is missing even though the provider gave a real % (the fix(frontend/recs): return null from effectiveSavingsPct on AWS reconstruction fallback (followup to #321) #323 case).

The CLI never has these problems because it uses the provider value directly. This is a CLI-vs-GUI parity gap on a money-path display.

Fix (full-stack)

  • Backend struct (internal/config/types.go): add nullable RecommendationRecord.SavingsPercentage *float64 (nil = provider did not report a %). Persisted via the recommendations row's JSONB payload column -- no DDL/migration needed (recs are stored as JSONB; same as OnDemandCost). Absent represented as nil, never 0.
  • Mapping (internal/scheduler/scheduler.go convertRecommendations, the only builder mapping a common rec to a record): set SavingsPercentage: nonZeroPtr(rec.SavingsPercentage), parity with OnDemandCost. A provider 0 round-trips as nil.
  • Frontend type (frontend/src/types.ts): add savings_percentage?: number | null to LocalRecommendation.
  • Frontend display/sort (frontend/src/recommendations.ts): the effective-% column and its sort accessor prefer r.savings_percentage when it is a finite, non-null number; fall back to effectiveSavingsPct(r) otherwise. Net effect: GUI shows the same number the CLI shows, and AWS recs missing on_demand_cost show the provider % instead of "—".

Scope

Full-stack (Go struct + scheduler mapping + frontend type + display/sort), implemented in PR #1104 alongside the net-savings fix.

Related: #323, #1035.

Activity

  1. added 3 commits that reference this issue on Jun 7, 2026
    a6f4069
    1fa33c0
    763f4ae
  2. added
    pr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)
    pr-mergedThe PR for this issue has been merged
    on Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/sHoursimpact/manyAffects most userspr-createdA PR has been opened for this issue (dedup guard for the auto-PR loop)pr-mergedThe PR for this issue has been mergedpriority/p2Backlog-worthyseverity/mediumModerate harmtriagedItem has been triagedtype/bugDefecturgency/this-sprintWithin the current sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions