Skip to content

fix(azure): pin pkg to the #491 recfilter selector and test the real Client - #627

Merged
IAmJSD merged 1 commit into
LeanerCloud:mainfrom
IAmJSD:fix/azure-pkg-pin-recfilter
Oct 26, 2026
Merged

IAmJSD merged 1 commit into
LeanerCloud:mainfrom
IAmJSD:fix/azure-pkg-pin-recfilter

Conversation

@IAmJSD

@IAmJSD IAmJSD commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Why

Follow-up promised in #491's review thread (CodeRabbit on pkg/recfilter/dedupe.go:96). #491 added the coveringCommitmentLister selector to recfilter.DuplicateChecker, so a savings plan billed to another subscription but applied to this one suppresses a re-buy. But providers/azure/go.mod still pinned pkg at 205cf99b, from before that selector. A standalone Azure-module build (GOWORK=off, which is how cli and mcp consume it) therefore never called GetCoveringCommitments, so those plans were left out of duplicate checks. The pin could only be bumped once #491's pkg change was on main.

What

  • providers/azure/go.mod: bump github.com/LeanerCloud/cloud-commitments-go/pkg from v0.0.0-20261020191912-205cf99b8ef3 to v0.0.0-20261026065151-8e125008e26c (the fix(azure): count savings plans billed to another subscription in the duplicate check #491 merge, via GOWORK=off go get ...@8e125008). go mod tidy changed nothing else, and no other dependency moved.
  • TestDuplicateChecker_PlanBilledToAnotherSubscription: drop the coveringView adapter, which fed the covering list in as inventory and so hid the stale pin. The test now passes the real Client to DuplicateChecker, so the standalone build is tested end to end.

Verification

Fail-before: with the test change applied and the old pin, GOWORK=off go test -run TestDuplicateChecker_PlanBilledToAnotherSubscription ./services/savingsplans/ fails 4 of 5 cases (single-ours, single-rg-ours, shared, management-group; the recommendation is not suppressed). single-other passes because it expects no suppression. With the new pin, all 5 pass.

Also run:

  • GOWORK=off in pkg and providers/azure: go build ./..., go vet ./..., go test -race -count=1 ./...
  • Workspace mode: go vet ./... and go test -race -short -count=1 ./... in all five modules
  • golangci-lint v2.10.1 with the repo .golangci.yml (as CI runs it) in pkg and providers/azure, in workspace and GOWORK=off mode: 0 issues. gocyclo -over 10 on non-test files: clean
  • Secrets scan of the changed files: clean

Note

cli and mcp also need their pkg and providers/azure pins bumped to pick up #491. Until they are, their builds still use the pre-#491 duplicate check.

🤖 Generated with Claude Code

…t the real Client

LeanerCloud#491 taught recfilter.DuplicateChecker to check recommendations against
GetCoveringCommitments when a client provides it, so a savings plan billed
to another subscription but applied to this one suppresses a re-buy. The
Azure module still required pkg at 205cf99, from before that selector, so
a standalone build (GOWORK=off, as cli and mcp consume this module) never
consulted the covering list and left those plans out of duplicate checks.

Bump the pkg requirement to 8e12500, the LeanerCloud#491 merge. go mod tidy changed
nothing else.

The duplicate-check test wrapped the Client in a coveringView adapter that
fed the covering list in as inventory, which hid the stale pin. It now
passes the real Client, so a standalone run fails on any pkg pin without
the selector: four of its five cases fail on 205cf99 and pass on 8e12500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@IAmJSD IAmJSD added priority/p2 Backlog-worthy severity/high Significant harm urgency/this-quarter Within the quarter impact/few Limited audience effort/m Days type/bug Defect labels Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@IAmJSD

IAmJSD commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE d4bfe556ae768961596173dc515ef0e978b214a9

Blocking:

  • none

Non-blocking:

Attacked:

  • Checked that 8e125008 is on main and is the fix(azure): count savings plans billed to another subscription in the duplicate check #491 merge, and that the pseudo-version timestamp 20261026065151 matches its UTC commit time. Under GOWORK=off, go mod verify passes and go mod tidy in providers/azure changes nothing.
  • GOWORK=off, default -mod=readonly, in pkg and in providers/azure: go build ./..., go vet ./... and go test -race -count=1 ./... all pass (13 and 14 test packages ok, no FAIL).
  • Fail-before: with the new test and main's go.mod/go.sum (old pin), GOWORK=off go test -run TestDuplicateChecker_PlanBilledToAnotherSubscription ./services/savingsplans/ fails single-ours, single-rg-ours, shared and management-group, while single-other passes. All five pass with the new pin, and also in workspace mode. Removing the coveringView adapter is what makes the test exercise the real Client through DuplicateChecker's own selector, so the test now proves the claim.

Body-stale:

  • none (the note's list of consumers is incomplete, see above)

Reviewer: rC6. Bar while the maintainers are away (set by IAmJSD as acting owner): one approving independent review on the head, two for money, auth and security paths.

@IAmJSD

IAmJSD commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Local verification at d4bfe556ae768961596173dc515ef0e978b214a9 (main merged in; the PR's diff is unchanged, so earlier reviews carry over; every module builds, vets and passes go test -race). CI Success and pre-commit green. Merged by IAmJSD's agent at IAmJSD's request (acting owner while the maintainers are away), under the bar IAmJSD set: an approving independent review (rC6). Squash-merged at exactly d4bfe556ae768961596173dc515ef0e978b214a9.

@IAmJSD
IAmJSD marked this pull request as ready for review October 26, 2026 07:39
@IAmJSD
IAmJSD merged commit b326103 into LeanerCloud:main Oct 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/m Days impact/few Limited audience priority/p2 Backlog-worthy severity/high Significant harm type/bug Defect urgency/this-quarter Within the quarter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant