Repository navigation
fix(azure): pin pkg to the #491 recfilter selector and test the real Client - #627
Conversation
…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>
|
Independent review (IAmJSD's agent, fresh context, given only the diff, the issue and the PR text): VERDICT: APPROVE Blocking:
Non-blocking:
Attacked:
Body-stale:
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. |
|
Local verification at |
Why
Follow-up promised in #491's review thread (CodeRabbit on
pkg/recfilter/dedupe.go:96). #491 added thecoveringCommitmentListerselector torecfilter.DuplicateChecker, so a savings plan billed to another subscription but applied to this one suppresses a re-buy. Butproviders/azure/go.modstill pinnedpkgat205cf99b, from before that selector. A standalone Azure-module build (GOWORK=off, which is how cli and mcp consume it) therefore never calledGetCoveringCommitments, so those plans were left out of duplicate checks. The pin could only be bumped once #491's pkg change was onmain.What
providers/azure/go.mod: bumpgithub.com/LeanerCloud/cloud-commitments-go/pkgfromv0.0.0-20261020191912-205cf99b8ef3tov0.0.0-20261026065151-8e125008e26c(the fix(azure): count savings plans billed to another subscription in the duplicate check #491 merge, viaGOWORK=off go get ...@8e125008).go mod tidychanged nothing else, and no other dependency moved.TestDuplicateChecker_PlanBilledToAnotherSubscription: drop thecoveringViewadapter, which fed the covering list in as inventory and so hid the stale pin. The test now passes the realClienttoDuplicateChecker, 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-otherpasses because it expects no suppression. With the new pin, all 5 pass.Also run:
GOWORK=offinpkgandproviders/azure:go build ./...,go vet ./...,go test -race -count=1 ./...go vet ./...andgo test -race -short -count=1 ./...in all five modules.golangci.yml(as CI runs it) inpkgandproviders/azure, in workspace andGOWORK=offmode: 0 issues.gocyclo -over 10on non-test files: cleanNote
cli and mcp also need their
pkgandproviders/azurepins bumped to pick up #491. Until they are, their builds still use the pre-#491 duplicate check.🤖 Generated with Claude Code