Skip to content

fix(azure,gcp): fabricated commitment prices (hardcoded discount %) surfaced as real quotes #1020

Description

@cristim

Problem. When the pricing API returns no reservation/commitment line, the code invents one from a hardcoded multiplier and surfaces it as a real OfferingDetails.TotalCost/SavingsPercentage:

  • Azure: reservationPrice = onDemandPrice * hoursInTerm * 0.62 (services/compute/client.go:620-624; parallel reservationPrice == 0 branches in cache:512, cosmosdb:504, database:513, search:448).
  • GCP: onDemand * hours * <0.63/0.45/0.85/...> (computeengine:760-766, cloudsql:446-452, memorystore:385-391, cloudstorage:439-445).

managedredis already does the right thing (returns an error when reservation pricing is missing).

Evidence. Azure 09-H4; GCP 10-M4. Violates feedback_nullable_not_zero / §5.

Impact. Misleading savings figures can justify uneconomical real purchases.

Suggested fix. Return an error (as managedredis does) or mark OfferingDetails.Estimated bool and omit SavingsPercentage when estimated, so the UI/CLI discloses it. Pairs with the savings-formula consolidation (I-20, report-12 D5).

References. Source: reports 09 (H4) + 10 (M4). Related: I-20 (shared SavingsPct with zero guard).


Filed from automated adversarial code review (see docs/code-review/). Source finding(s): 09-H4, 10-M4.

No activity

Activity on this issue will appear here.

Activity

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