Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-4621

Use tally snapshot service level / usage dimensions for capacity lookup in swatch-contracts

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • swatch-contracts
    • None
    • 3
    • False
    • Hide

      None

      Show
      None
    • False
    • subs-swatch-lightning

      When swatch-tally produces daily snapshots, it creates multiple snapshots for different filter dimensions (SLA, Usage). For example, one snapshot might represent "all usage" (_ANY/_ANY) while another might represent a specific SLA/Usage combination like Self-Support/Development/Test. Each of these snapshots is then enriched with subscription capacity by swatch-contracts and checked for over-usage by swatch-utilization.

      The problem is in how swatch-contracts looks up subscription capacity. The SubscriptionCapacityService.buildSpecificationForSnapshot() method hardcodes ServiceLevel._ANY and Usage._ANY when searching for capacity, completely ignoring the SLA and Usage dimensions of the snapshot being processed. This means that a snapshot for Self-Support/Development/Test usage gets compared against the capacity of subscriptions that are actually Standard/Production – subscriptions that don't cover that SLA/Usage combination at all.

      More context: https://docs.google.com/document/d/1UbphvA0ydHw7E-1D4I-YQLnGn8Im1WxxLzDhVAkUF6Y/edit?tab=t.5ite0o303v41
      Initial pull request: https://github.com/RedHatInsights/rhsm-subscriptions/pull/5814

      Acceptance Criteria

      • Update the swatch-contracts test plan to reproduce the above scenario
      • Implement the component test for the newly created test plan
      • Fix the filtering issue

              Unassigned Unassigned
              jcarvaja@redhat.com Jose Carvajal Hilario
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: