Skip to content

chore(config): tie suppression slug aliases to the library constants and cover Savings Plans spellings #1422

Closed

Description

@cristim

Follow-up from the #1421 reviews (#1420).

  1. Drift between the alias tables. awsLegacyServiceSlugs in internal/config/types.go maps the legacy AWS slugs to canonical slugs written as string literals. mapServiceSlug in internal/purchase/execution.go holds the same pairs. The two only point at each other in comments, so a new alias added to one and not the other would bring back the suppression double-buy from fix(config): canonicalise every AWS service alias in purchase suppressions, not only ec2/compute #1420. Fix: write the canonical values as string(common.Service*) constants from cloud-commitments-go, and add a test that every legacy key in mapServiceSlug has an entry in awsLegacyServiceSlugs.
  2. Savings Plans spelling aliases. mapSavingsPlansSlug accepts both the hyphenated and the dash-free spellings, but purchase suppressions compare them literally. This is low reach, since the frontend sends only one spelling. If it gets fixed, canonicalise only the spelling of each per-type slug. Never fold the savingsplans umbrella into the per-type slugs, because one umbrella suppression would then hide every plan type.

Verify reachability for item 2 before changing anything.

Activity

  1. cristim commented on Oct 26, 2026

    @cristim
    MemberAuthor

    Item 1 is in #1425.

    Item 2 finding, no code change: today only a direct API client can reach it.

    • AWS Savings Plans recs get Service from the library collector, and the only Savings Plans constants in common/types.go (~126) are hyphenated (savings-plans-compute, etc.).
    • The frontend sends only the hyphenated per-type slugs (frontend/src/plans.ts ~713, settings.ts ~700).
    • The dash-free per-type keys appear only in mapSavingsPlansSlug, where they are accepted but never emitted, and nothing in the repo produces them.
    • The dash-free savingsplans is the Azure Savings Plans service slug (probe_azure.go ~15), so it must never be folded into the AWS per-type slugs.

    I'm leaving this open at P3 for item 2. It's fine to close it as won't-fix if nothing starts emitting the dash-free per-type slugs.

  2. IAmJSD commented on Oct 26, 2026

    @IAmJSD
    Collaborator

    Claiming: working on this

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