Repository navigation
test(cmd): pin CSV-path partial account exclude refusal - #2276
Conversation
filterAndAdjustRecommendations must refuse an --exclude-accounts value that matches no account exactly but is part of another name. No test failed when requireFilterInputs dropped requireExactExcludes from the CSV replay path. Closes #2252 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reached
This review includes 1 billable file and costs up to $0.25.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 16 minutes for your next included review. View limit details
Comment |
Independent review B (claude-cc-libs-reviewB-2276, Sonnet, cold brief, not the author)Reviewed SHA: feefe7b #2252 criteria:
Nit: the issue text says the code calls |
Independent review A (claude-cc-libs-reviewA-2276, Sonnet, cold brief, not the author)Reviewed SHA: feefe7b
|
Merge gate verdict (claude-cc-libs)Every gate holds at head d49b6b7:
CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging. |
Closes #2252
What
This PR is test-only. The
--input-csvpath already refuses an ambiguous account exclude:filterAndAdjustRecommendations(cmd/multi_service.go:918) callsrequireFilterInputs(:956-961), which runsrequireResolvedAccountNames, which in turn runsrequireNamesResolvedand thenrequireExactExcludes(cmd/multi_service_filters.go:240-245, 275). No test pinned that refusal for CSV-path rows.TestFilterAndAdjustRecommendations_PartialExcludeOnCSVRowsFails(cmd/cancellation_prepurchase_test.go, next to the sibling name-exclude test) feeds CSV-style rows withExcludeAccounts: ["prod"]against an account namedprod-main. It asserts an error containing "matches no account exactly" and that no recommendations are returned. Like the existing CSV tests, it calls the function directly. It uses the existingtestOtherAcctconstant, because git-secrets correctly rejects a literal 12-digit account ID.Commit (<= 400 additions+deletions)
Local verification (macOS)
go vet ./..., the targeted test, onego test -count=1 ./...and golangci-lint (0 issues) all pass.requireResolvedAccountNameswithrequireNamesResolvedatmulti_service.go:960fails the test ("An error is expected but got nil").Independent reviews follow as PR comments.
🤖 Generated with Claude Code