Skip to content

feat(recommendations): option-B read-time filter for enabled / coverage / include-exclude per-account override fields #196

@cristim

Description

@cristim

Context

Issue #111 verified that per-account account_service_overrides are read by ZERO call sites in the recommendations / scheduling pipeline (every override row is decorative until consumed). The user-approved fix landed in PR #193 — overrides now pre-populate the purchase forms (sub-options ii + iii: per-bucket Payment in the fan-out modal, and per-row Term/Payment in the single-bucket modal). Recommendations themselves stay unfiltered, by design.

That leaves the other override fields still decorative:

  • enabled (when set to false, recs for that account/service should be hidden)
  • coverage (per-account target % — affects what's "remaining" to recommend)
  • include_engines / exclude_engines
  • include_regions / exclude_regions
  • include_types / exclude_types
  • ramp_schedule

These all shape what the engine should list / aggregate for an account — not what to do at purchase time. Pre-populating purchase forms with payment doesn't move the needle for any of them.

What needs to happen

Wire per-account override lookup into the recommendations read path (option B from the issue #111 architectural fork):

  1. Extend RecommendationFilter (internal/api/recommendations.go and friends) with account-aware predicates.
  2. ListStoredRecommendations (and any sibling that backs the dashboard aggregator) consults account_service_overrides per row's cloud_account_id and applies:
    • enabled = false → skip the account's recs entirely for that service.
    • include_engines / exclude_engines (and the region / type pairs) → drop non-matching rows.
    • coverage → cap the headline "potential savings" to the configured target (related to follow-up issue on dashboard accuracy).
  3. Frontend: when the user has the per-account-override panel open and changes a filter field, trigger a recommendations refresh (or invalidate the cached visible set).
  4. Integration test that mirrors the original verify recommendations engine actually consumes per-account service overrides #111 acceptance criterion: seed a global ServiceConfig + a per-account override; trigger collection / list; assert the listed recs reflect the override.

References

Effort & priority

Out of scope

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