Skip to content

fix(recfilter): dedupe reduces Count without scaling cost and savings; add shared ResizeCount helper #370

Closed

Description

@cristim

adjustSingleRecommendation (pkg/recfilter/dedupe.go ~260) sets Count to the remaining count but leaves CommitmentCost, OnDemandCost, EstimatedSavings, RecurringMonthlyCost at full-count values. Same pattern as the CLI extended-support cut (cmd/multi_service_engine_versions.go ~497), a sibling of closed CLI #1830/#1844. Related: #323 (dedupe key dimensions, not addressed here).

Fix: add common.ResizeCount(rec, n) that scales via ScaleRecommendationCosts by n/rec.Count and errors on a non-positive source count; use it in dedupe. The CLI cut can reuse it after the go.mod bump.

Activity

  1. IAmJSD commented on Oct 15, 2026

    @IAmJSD
    Collaborator

    Released: this turned out to be already fixed on main (details in the comment below), so I'm not working on it.

  2. IAmJSD commented on Oct 15, 2026

    @IAmJSD
    Collaborator

    Releasing my claim: this is already fixed. #379 (merged 2026-10-13 as 6fd189f, Refs #370) added common.ResizeCount and uses it in dedupe; TestAdjustRecommendationsForExisting_PartialCoverageScalesMoney fails on the pre-#379 dedupe and passes on main. The CLI half is done too: cmd/multi_service_engine_versions.go already calls common.ResizeCount, and the CLI's go.mod pin (9b35837) contains 6fd189f. I think this can be closed.

  3. IAmJSD commented on Oct 15, 2026

    @IAmJSD
    Collaborator

    @cristim could you close this one? It was fixed by #379 (which used Refs rather than Closes, so it stayed open).

  4. cristim commented on Oct 16, 2026

    @cristim
    MemberAuthor

    Checked against main 740dfbd: #379 (6fd189f) added common.ResizeCount (pkg/common/resize.go:14) and the duplicate checker uses it. It used Refs, so this stayed open. Marking needs-info for a close decision.

  5. added
    status/needs-infoAwaiting clarification from the asker
    and removed
    status/needs-infoAwaiting clarification from the asker
    on Oct 16, 2026
  6. cristim commented on Oct 17, 2026

    @cristim
    MemberAuthor

    Closing as completed per owner decision (2026-10-17): fixed by #379 (6fd189f, common.ResizeCount used by the dedupe). That PR said 'Refs' instead of 'Closes', so this stayed open.

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